diff --git a/cv_bridge/CMakeLists.txt b/cv_bridge/CMakeLists.txt index 942cb0fac..69ffc9fcc 100644 --- a/cv_bridge/CMakeLists.txt +++ b/cv_bridge/CMakeLists.txt @@ -66,7 +66,15 @@ if(NOT CV_BRIDGE_DISABLE_PYTHON) ) endif() +# add library +add_library(${PROJECT_NAME}) add_subdirectory(src) +target_include_directories(${PROJECT_NAME} + PUBLIC + $ + $ +) +target_link_libraries(${PROJECT_NAME} PUBLIC Boost::python) # cv_bridge_lib_dir is passed as APPEND_LIBRARY_DIRS for each ament_add_gtest call so # the project library that they link against is on the library path. diff --git a/cv_bridge/src/CMakeLists.txt b/cv_bridge/src/CMakeLists.txt index 76ccfd9f9..38fcd6e4c 100644 --- a/cv_bridge/src/CMakeLists.txt +++ b/cv_bridge/src/CMakeLists.txt @@ -1,15 +1,14 @@ -# add library -add_library(${PROJECT_NAME} +target_sources(${PROJECT_NAME} PRIVATE cv_bridge.cpp cv_mat_sensor_msgs_image_type_adapter.cpp rgb_colors.cpp ) include(GenerateExportHeader) generate_export_header(${PROJECT_NAME} EXPORT_FILE_NAME ${PROJECT_NAME}/${PROJECT_NAME}_export.h) -target_include_directories(${PROJECT_NAME} PUBLIC - "$" - "$" - "$") +target_include_directories(${PROJECT_NAME} + PUBLIC + $ +) target_link_libraries(${PROJECT_NAME} PUBLIC ${sensor_msgs_TARGETS} opencv_core