Skip to content

missing CMake targets on humble #2479

@christian-rauch

Description

@christian-rauch

Describe the bug
I am trying to replace ament_target_dependencies with target_link_libraries. In the suggested targets:

target_link_libraries(my_robot_hardware PUBLIC
  hardware_interface::hardware_interface
  hardware_interface::mock_components
  rclcpp::rclcpp
)

none of the targets in the hardware_interface:: namespace are available under humble.

Looking at the bloomed package, I can see that under jazzy, there is a /opt/ros/jazzy/share/hardware_interface/cmake/export_hardware_interfaceExport.cmake with the exported targets hardware_interface::hardware_interface and hardware_interface::mock_components. But there is no such equivalent file that exports these targets in the humble package.

To Reproduce
Steps to reproduce the behavior:

  1. find_package(hardware_interface REQUIRED)
  2. link a target with target_link_libraries(my_hardware PUBLIC hardware_interface::hardware_interface hardware_interface::mock_components)

You can also manually list the imported targets with:

get_property(my_tgts DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" PROPERTY IMPORTED_TARGETS)
foreach(t ${my_tgts})
    message(WARNING "  ${t}")
endforeach()

and see that those targets are not defined.

Expected behavior
The hardware_interface should export its CMake targets inside the hardware_interface:: namespace.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • Version Humble

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions