Skip to content

Commit

Permalink
Fix build errors in Ubuntu Lunar when fetched directly
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Friedman <[email protected]>
  • Loading branch information
Ryanf55 committed Jun 24, 2023
1 parent b6842b0 commit 48a45e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
8 changes: 8 additions & 0 deletions cv_bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
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.
Expand Down
11 changes: 5 additions & 6 deletions cv_bridge/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)
target_link_libraries(${PROJECT_NAME} PUBLIC
${sensor_msgs_TARGETS}
opencv_core
Expand Down

0 comments on commit 48a45e8

Please sign in to comment.