Remove ament_target_dependencies to match ROS 2 Rolling#32
Conversation
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Greptile SummaryThis PR changes the CMake linking approach from ROS 2's Key changes:
Concerns:
Confidence Score: 3/5
Important Files Changed
Last reviewed commit: 834eb64 |
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
| target_link_libraries(greenwave_monitor | ||
| greenwave_diagnostics | ||
| ${rclcpp_TARGETS} | ||
| ${std_msgs_TARGETS} | ||
| ${diagnostic_msgs_TARGETS} | ||
| ${greenwave_monitor_interfaces_TARGETS} | ||
| ) |
There was a problem hiding this comment.
Changed from ament_target_dependencies() to target_link_libraries() with ${package_TARGETS} variables. This deviates from standard ROS 2 practice. ament_target_dependencies() is the recommended approach as it properly handles include directories, link libraries, and compile definitions across different ROS 2 versions.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
ament_target_dependencies is deprecated, so we need to switch.
Additional Comments (1)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
Apparently ROS 2 on rolling is fully deprecating ament_target_dependencies 😮 #572
Update the Cmakelist to do the same. Recently in Jan 2026 it was fully removed. The post I linked is the reasons for doing it.