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

Switch to target_link_libraries. #776

Merged
merged 1 commit into from
Nov 27, 2023
Merged
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
9 changes: 4 additions & 5 deletions rosidl_runtime_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ add_library(${PROJECT_NAME}
target_include_directories(${PROJECT_NAME} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
ament_target_dependencies(${PROJECT_NAME}
"rcutils"
"rosidl_typesupport_interface")
target_link_libraries(${PROJECT_NAME} PUBLIC
rcutils::rcutils
rosidl_typesupport_interface::rosidl_typesupport_interface
)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set_target_properties(${PROJECT_NAME} PROPERTIES
COMPILE_OPTIONS -Wall -Wextra -Wpedantic)
Expand Down Expand Up @@ -116,8 +117,6 @@ if(BUILD_TESTING)

ament_add_gtest(test_sequence_bound test/test_sequence_bound.cpp)
if(TARGET test_sequence_bound)
ament_target_dependencies(test_sequence_bound
"rosidl_typesupport_interface")
target_link_libraries(test_sequence_bound ${PROJECT_NAME})
endif()

Expand Down
13 changes: 5 additions & 8 deletions rosidl_typesupport_introspection_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ find_package(ament_cmake_ros REQUIRED)
find_package(rosidl_runtime_cpp REQUIRED)
find_package(rosidl_typesupport_introspection_c REQUIRED)

ament_export_dependencies(rosidl_runtime_c)
ament_export_dependencies(rosidl_runtime_cpp)
ament_export_dependencies(rosidl_typesupport_interface)
ament_export_dependencies(rosidl_typesupport_introspection_c)

ament_export_dependencies(rosidl_runtime_cpp rosidl_typesupport_introspection_c)
clalancette marked this conversation as resolved.
Show resolved Hide resolved

ament_python_install_package(${PROJECT_NAME})

Expand All @@ -32,9 +28,10 @@ endif()
target_include_directories(${PROJECT_NAME} PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include/${PROJECT_NAME}>")
ament_target_dependencies(${PROJECT_NAME}
rosidl_runtime_cpp
rosidl_typesupport_introspection_c)
target_link_libraries(${PROJECT_NAME} PUBLIC
rosidl_runtime_cpp::rosidl_runtime_cpp
rosidl_typesupport_introspection_c::rosidl_typesupport_introspection_c
)

# Export old-style CMake variables
ament_export_include_directories("include/${PROJECT_NAME}")
Expand Down