Skip to content

Commit

Permalink
Use target_link_libraries (#83)
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
  • Loading branch information
ahcorde authored Jul 10, 2024
1 parent 5a27290 commit 59a0a0e
Showing 1 changed file with 31 additions and 37 deletions.
68 changes: 31 additions & 37 deletions turtle_tf2_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,58 +37,52 @@ find_file(TF2_CPP_HEADERS
)

add_executable(static_turtle_tf2_broadcaster src/static_turtle_tf2_broadcaster.cpp)
ament_target_dependencies(
static_turtle_tf2_broadcaster
geometry_msgs
rclcpp
tf2
tf2_ros
target_link_libraries(static_turtle_tf2_broadcaster PRIVATE
${geometry_msgs_TARGET}
rclcpp::rclcpp
tf2::tf2
tf2_ros::tf2_ros
)

add_executable(turtle_tf2_broadcaster src/turtle_tf2_broadcaster.cpp)
ament_target_dependencies(
turtle_tf2_broadcaster
geometry_msgs
rclcpp
tf2
tf2_ros
turtlesim_msgs
target_link_libraries(turtle_tf2_broadcaster PRIVATE
${geometry_msgs_TARGET}
rclcpp::rclcpp
tf2::tf2
tf2_ros::tf2_ros
${turtlesim_msgs_TARGETS}
)

add_executable(turtle_tf2_listener src/turtle_tf2_listener.cpp)
ament_target_dependencies(
turtle_tf2_listener
geometry_msgs
rclcpp
tf2
tf2_ros
turtlesim_msgs
target_link_libraries(turtle_tf2_listener PRIVATE
${geometry_msgs_TARGET}
rclcpp::rclcpp
tf2::tf2
tf2_ros::tf2_ros
${turtlesim_msgs_TARGETS}
)

add_executable(fixed_frame_tf2_broadcaster src/fixed_frame_tf2_broadcaster.cpp)
ament_target_dependencies(
fixed_frame_tf2_broadcaster
geometry_msgs
rclcpp
tf2_ros
target_link_libraries(fixed_frame_tf2_broadcaster PRIVATE
${geometry_msgs_TARGET}
rclcpp::rclcpp
tf2_ros::tf2_ros
)

add_executable(dynamic_frame_tf2_broadcaster src/dynamic_frame_tf2_broadcaster.cpp)
ament_target_dependencies(
dynamic_frame_tf2_broadcaster
geometry_msgs
rclcpp
tf2_ros
target_link_libraries(dynamic_frame_tf2_broadcaster PRIVATE
${geometry_msgs_TARGETS}
rclcpp::rclcpp
tf2_ros::tf2_ros
)

add_executable(turtle_tf2_message_filter src/turtle_tf2_message_filter.cpp)
ament_target_dependencies(
turtle_tf2_message_filter
geometry_msgs
message_filters
rclcpp
tf2_geometry_msgs
tf2_ros
target_link_libraries(turtle_tf2_message_filter PRIVATE
${geometry_msgs_TARGETS}
message_filters::message_filters
rclcpp::rclcpp
${tf2_geometry_msgs_TARGETS}
tf2_ros::tf2_ros
)

if(EXISTS ${TF2_CPP_HEADERS})
Expand Down

0 comments on commit 59a0a0e

Please sign in to comment.