Best Practices for Replacing ament_target_dependencies in Kilted While Maintaining Compatibility

By the way, CMake is introducing a similar concept as part of the introduction of Common Package Specification (CPS) files to replace CMake config files, see for example from https://www.kitware.com/navigating-cmake-dependencies-with-cps/ :

This means that imported targets generated from a CPS will always have the form a::b, with one exception—some packages may provide an INTERFACE target with the same name as the package which references that package’s default_components.

In a nutshell, that would mean that for example you will be able to have:

find_package(<pkgname> REQUIRED)
target_link_libraries([..] PRIVATE <pkgname>)

to link the “default_components” targets of <pkgname>, a bit like the old ${<pkgname>_TARGETS} convention of ROS. Anyhow, realistically non-experimental full support for CPS will land in apt packages if all goes well only in Ubuntu 26.04, so it will take several years to be usuable by ROS, so a convention of having a <pkgname>::<pkgname> target for each ROS/ament package makes perfectly sense!

1 Like