Skip to content

Commit cc729b0

Browse files
mergify[bot]DLuahcordesaikishor
authored
[kilted] Update deprecated call to ament_target_dependencies (backport #575) (#576)
Co-authored-by: David V. Lu!! <davidvlu@gmail.com> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Co-authored-by: Sai Kishor Kothakota <sai.kishor@pal-robotics.com>
1 parent a119213 commit cc729b0

File tree

2 files changed

+29
-32
lines changed

2 files changed

+29
-32
lines changed

gz_ros2_control/CMakeLists.txt

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,28 @@ add_library(${PROJECT_NAME}-system SHARED
3737
)
3838

3939
target_link_libraries(${PROJECT_NAME}-system
40+
PUBLIC
4041
gz-sim::gz-sim
4142
gz-plugin::register
42-
)
43-
ament_target_dependencies(${PROJECT_NAME}-system
44-
ament_index_cpp
45-
controller_manager
46-
hardware_interface
47-
pluginlib
48-
rclcpp
49-
yaml_cpp_vendor
50-
rclcpp_lifecycle
43+
ament_index_cpp::ament_index_cpp
44+
controller_manager::controller_manager
45+
hardware_interface::mock_components
46+
pluginlib::pluginlib
47+
rclcpp::rclcpp
48+
rclcpp_lifecycle::rclcpp_lifecycle
5149
)
5250

5351
#########
5452

5553
add_library(gz_hardware_plugins SHARED
5654
src/gz_system.cpp
5755
)
58-
ament_target_dependencies(gz_hardware_plugins
59-
rclcpp_lifecycle
60-
hardware_interface
61-
rclcpp
62-
)
6356
target_link_libraries(gz_hardware_plugins
57+
PUBLIC
6458
gz-sim::gz-sim
59+
hardware_interface::mock_components
60+
rclcpp::rclcpp
61+
rclcpp_lifecycle::rclcpp_lifecycle
6562
)
6663

6764
## Install

gz_ros2_control_demos/CMakeLists.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,38 +31,38 @@ install(DIRECTORY
3131
)
3232

3333
add_executable(example_position examples/example_position.cpp)
34-
ament_target_dependencies(example_position
35-
rclcpp
36-
rclcpp_action
37-
control_msgs
34+
target_link_libraries(example_position PUBLIC
35+
${control_msgs_TARGETS}
36+
rclcpp::rclcpp
37+
rclcpp_action::rclcpp_action
3838
)
3939

4040
# use the same example_position.cpp for example_velocity
4141
add_executable(example_velocity examples/example_position.cpp)
42-
ament_target_dependencies(example_velocity
43-
rclcpp
44-
rclcpp_action
45-
control_msgs
42+
target_link_libraries(example_velocity PUBLIC
43+
${control_msgs_TARGETS}
44+
rclcpp::rclcpp
45+
rclcpp_action::rclcpp_action
4646
)
4747

4848
# use the same example_position.cpp for example_effort
4949
add_executable(example_effort examples/example_position.cpp)
50-
ament_target_dependencies(example_effort
51-
rclcpp
52-
rclcpp_action
53-
control_msgs
50+
target_link_libraries(example_effort PUBLIC
51+
${control_msgs_TARGETS}
52+
rclcpp::rclcpp
53+
rclcpp_action::rclcpp_action
5454
)
5555

5656
add_executable(example_mobile_robots examples/example_mobile_robots.cpp)
57-
ament_target_dependencies(example_mobile_robots
58-
rclcpp
59-
geometry_msgs
57+
target_link_libraries(example_mobile_robots
58+
rclcpp::rclcpp
59+
${geometry_msgs_TARGETS}
6060
)
6161

6262
add_executable(example_gripper examples/example_gripper.cpp)
63-
ament_target_dependencies(example_gripper
64-
rclcpp
65-
std_msgs
63+
target_link_libraries(example_gripper PUBLIC
64+
${std_msgs_TARGETS}
65+
rclcpp::rclcpp
6666
)
6767

6868
if(BUILD_TESTING)

0 commit comments

Comments
 (0)