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 build errors in Ubuntu Lunar when fetched directly #511

Open
wants to merge 1 commit into
base: rolling
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion cv_bridge/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ 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>
)

# 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 All @@ -87,7 +93,7 @@ ament_export_dependencies(
ament_export_targets(export_${PROJECT_NAME})

# install the include folder
install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME})
install(DIRECTORY include/ DESTINATION include)

install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
Expand Down
14 changes: 7 additions & 7 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 All @@ -25,11 +24,12 @@ install(TARGETS ${PROJECT_NAME} EXPORT export_${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/${PROJECT_NAME}_export.h
DESTINATION include/${PROJECT_NAME}/${PROJECT_NAME})
DESTINATION include/${PROJECT_NAME})

if(NOT CV_BRIDGE_DISABLE_PYTHON)
Python3_add_library(${PROJECT_NAME}_boost MODULE module.cpp module_opencv4.cpp)
Expand Down