Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linker error to gst_base_sink_get_type #26

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.6)

project(gscam2)

Expand Down Expand Up @@ -27,9 +27,9 @@ if($ENV{CLION_IDE})
endif()

# Gstreamer doesn't provide CMake files
find_package(PkgConfig)
pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0)
pkg_check_modules(GST_APP REQUIRED gstreamer-app-1.0)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GSTREAMER REQUIRED gstreamer-1.0 IMPORTED_TARGET)
pkg_check_modules(GST_APP REQUIRED gstreamer-app-1.0 IMPORTED_TARGET)

find_package(ament_cmake REQUIRED)
find_package(camera_calibration_parsers REQUIRED)
Expand All @@ -50,28 +50,28 @@ set(node_plugins "")
# GSCam node
#=============

set(GSCAM_NODE_SOURCES
src/gscam_node.cpp)

set(GSCAM_NODE_DEPS
camera_calibration_parsers
camera_info_manager
class_loader
GST_APP
rclcpp
rclcpp_components
ros2_shared
sensor_msgs)

add_library(gscam_node SHARED
${GSCAM_NODE_SOURCES})
add_library(gscam_node SHARED)
target_sources(gscam_node PRIVATE src/gscam_node.cpp)
add_library(gscam2::gscam_node ALIAS gscam_node)

target_compile_definitions(gscam_node
PRIVATE "COMPOSITION_BUILDING_DLL")

ament_target_dependencies(gscam_node
${GSCAM_NODE_DEPS})

target_link_libraries(gscam_node PkgConfig::GSTREAMER PkgConfig::GST_APP)
target_include_directories(gscam_node PUBLIC
"$<BUILD_INTERFACE:${GSTREAMER_INCLUDE_DIRS}>")
rclcpp_components_register_nodes(gscam_node "gscam2::GSCamNode")
set(node_plugins "${node_plugins}gscam2::GSCamNode;$<TARGET_FILE:gscam_node>\n")

Expand Down Expand Up @@ -105,12 +105,13 @@ set(node_plugins "${node_plugins}gscam2::ImageSubscriberNode;$<TARGET_FILE:subsc
#=============

add_executable(gscam_main
src/gscam_main.cpp
${GSCAM_NODE_SOURCES})
src/gscam_main.cpp)

ament_target_dependencies(gscam_main
${GSCAM_NODE_DEPS})

target_link_libraries(gscam_main gscam2::gscam_node)

#=============
# Manual composition of camera and subscriber nodes, IPC=true
#=============
Expand Down