Skip to content

Fix Rolling CI: migrate from ament_target_dependencies to target_link_libraries #241

@bburda

Description

@bburda

Bug report

Rolling CI fails on build because ament_target_dependencies was removed from ament_cmake in Rolling.

Steps to reproduce

  1. Push any commit to a branch with CI
  2. Observe build-and-test (rolling, ubuntu:noble) job failure

Expected behavior

Rolling build succeeds (currently continue-on-error: true so it's non-blocking).

Actual behavior

CMake Error at CMakeLists.txt:59 (ament_target_dependencies):
  Unknown CMake command "ament_target_dependencies".

Fails in ros2_medkit_serialization (and would fail in all other packages too).

Environment

  • ros2_medkit version: main (HEAD)
  • ROS 2 distro: Rolling
  • OS: Ubuntu Noble (24.04)

Additional information

28 occurrences across 7 CMakeLists.txt files need migration:

  • ros2_medkit_gateway/CMakeLists.txt (5 occurrences)
  • ros2_medkit_serialization/CMakeLists.txt (4 occurrences)
  • ros2_medkit_fault_manager/CMakeLists.txt (5 occurrences)
  • ros2_medkit_diagnostic_bridge/CMakeLists.txt (3 occurrences)
  • ros2_medkit_fault_reporter/CMakeLists.txt (2 occurrences)
  • ros2_medkit_integration_tests/CMakeLists.txt (9 occurrences)

The replacement is target_link_libraries with proper CMake targets. See ROS 2 Rolling ament_cmake docs.

Consider adding a compat shim in cmake/ROS2MedkitCompat.cmake that defines ament_target_dependencies as a wrapper around target_link_libraries on Rolling, to avoid touching every CMakeLists.txt.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions