Skip to content

Commit f33d772

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

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
@@ -130,8 +130,6 @@ if(BUILD_TESTING)
130130
# We do not expose `rmw_isoliation` via CMake.
131131
_TEST_DISABLE_RMW_ISOLATION
132132
)
133-
# N.B. We cannot use `ament_target_dependencies` because we cannot access this
134-
# package's exported ament target.
135133
target_link_libraries(test_pub_sub
136134
drake::drake
137135
drake_ros_core

0 commit comments

Comments
 (0)