Skip to content

Commit cf6367e

Browse files
ament_target_dependencies is an old and mysterious beast; avoid it
see - ament/ament_cmake#405 - ros2/rosidl#400 (comment)
1 parent 1fd2dce commit cf6367e

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

drake_ros_core/CMakeLists.txt

+7-9
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ add_library(drake_ros_core
3535
src/subscription.cc
3636
)
3737

38-
ament_target_dependencies(drake_ros_core
39-
Eigen3
40-
drake
41-
geometry_msgs
42-
rclcpp
43-
rosidl_runtime_c
44-
rosidl_typesupport_cpp
38+
target_link_libraries(drake_ros_core PUBLIC
39+
Eigen3::Eigen
40+
drake::drake
41+
${geometry_msgs_TARGETS}
42+
rclcpp::rclcpp
43+
rosidl_runtime_c::rosidl_runtime_c
44+
rosidl_typesupport_cpp::rosidl_typesupport_cpp
4545
)
4646

4747
target_include_directories(drake_ros_core
@@ -116,8 +116,6 @@ if(BUILD_TESTING)
116116
# We do not expose `rmw_isoliation` via CMake.
117117
_TEST_DISABLE_RMW_ISOLATION
118118
)
119-
# N.B. We cannot use `ament_target_dependencies` because we cannot access this
120-
# package's exported ament target.
121119
target_link_libraries(test_pub_sub
122120
drake::drake
123121
drake_ros_core

0 commit comments

Comments
 (0)