Skip to content

Document best practice for building executables with ament_cmake #299

Open
@nnmm

Description

@nnmm

The ament_cmake user documentation only has a section for building a library, but not for building a binary. Some parts are not straightforward to adapt to that use case, for instance:

  • Is there still a use case for ament_export_targets? Since it has an option HAS_LIBRARY_TARGET I think it also does something useful when there's no library target, but I'm not sure what – the motivating example for ament_export_targets, i.e. to be able to do target_link_libraries(client_lib my_lib::my_lib) applies only to libraries.
  • The text that goes over the install command, and the command itself, sounds like could be used as-is for binaries. That is not the case, since ros2 run doesn't find executables in bin, only in lib/${PROJECT_NAME}

If someone answers the first question and points out additional things to mention, I can try writing that section.

¹ In fact, the install call in the docs has destinations lib and bin, shouldn't that have ${PROJECT_NAME} as well?

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