From 0c9b309995d91bf27b263c9b94aed57c20e392e8 Mon Sep 17 00:00:00 2001 From: Ryan Friedman Date: Fri, 23 Jun 2023 18:41:33 -0600 Subject: [PATCH] Fix build errors in Ubuntu Lunar when fetched directly Signed-off-by: Ryan Friedman --- cv_bridge/CMakeLists.txt | 7 +++++++ cv_bridge/src/CMakeLists.txt | 11 +++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cv_bridge/CMakeLists.txt b/cv_bridge/CMakeLists.txt index 942cb0fac..77c2466e9 100644 --- a/cv_bridge/CMakeLists.txt +++ b/cv_bridge/CMakeLists.txt @@ -66,7 +66,14 @@ if(NOT CV_BRIDGE_DISABLE_PYTHON) ) endif() +# add library +add_library(${PROJECT_NAME}) add_subdirectory(src) +target_include_directories(${PROJECT_NAME} + PUBLIC + $ + $ +) # 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