Deprecate ament_target_dependencies()#572
Merged
Merged
Conversation
Signed-off-by: Shane Loretz <sloretz@intrinsic.ai>
Signed-off-by: Shane Loretz <sloretz@intrinsic.ai>
sloretz
marked this pull request as ready for review
March 26, 2025 20:31
christophebedard
approved these changes
Apr 5, 2025
christophebedard
left a comment
Member
There was a problem hiding this comment.
That's probably the most helpful deprecation warning I've seen 👏
Contributor
Author
|
Pulls: #572 |
cottsay
approved these changes
Apr 5, 2025
1 task
Rayman
added a commit
to ros-perception/perception_pcl
that referenced
this pull request
May 22, 2025
`ament_target_dependencies` is deprecated rolling, so we should convert all usages to `target_link_libraries`. See also the following discussion: ament/ament_cmake#572
SteveMacenski
pushed a commit
to ros-perception/perception_pcl
that referenced
this pull request
May 22, 2025
`ament_target_dependencies` is deprecated rolling, so we should convert all usages to `target_link_libraries`. See also the following discussion: ament/ament_cmake#572
This was referenced Aug 21, 2025
AntoBrandi
pushed a commit
to AntoBrandi/perception_pcl
that referenced
this pull request
Aug 26, 2025
`ament_target_dependencies` is deprecated rolling, so we should convert all usages to `target_link_libraries`. See also the following discussion: ament/ament_cmake#572
jcfurey
pushed a commit
to jcfurey/ouster-ros
that referenced
this pull request
May 17, 2026
`ament_target_dependencies()` is being deprecated in newer ROS 2 distros (ament/ament_cmake#572, merged Apr 2025). In rolling/lyrical, the ament_cmake metapackage no longer hard-depends on ament_cmake_target_dependencies — it's now only a build_export_depend. Consumers that still call `ament_target_dependencies()` need to opt in by find_package'ing the dedicated package and declaring it as a buildtool_depend so rosdep installs it. This unblocks the lyrical Docker build: CMake Error at CMakeLists.txt:103 (ament_target_dependencies): Unknown CMake command \"ament_target_dependencies\". Migration to direct \`target_link_libraries(target pkg::pkg)\` / \`\${pkg_TARGETS}\` is the longer-term fix but out of scope here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There are no more uses of
ament_target_dependencies()in the core 🎉Requires #571Requires ros2/system_tests#566This PR deprecates
ament_target_dependencies()in favor oftarget_link_libraries(). This PR also adds a deprecation warning that suggests atarget_link_libraries()call to be used instead.For example, I inserted a call to
ament_target_dependenciesinto my local copy oftf2_ros:I got the following deprecation warning when I built it.
The suggested
target_link_libraries()call matches the real call (minus a difference in sorting)https://github.com/ros2/geometry2/blob/d60e39d663e21d2e426a2a7ff3e3d266df6f8c9a/tf2_ros/CMakeLists.txt#L37-L44
#292