Skip to content

Feature Req: allow header installation path to be customized #841

@Gyebro

Description

@Gyebro

Feature request

Feature description

Currently rosidl installs generated headers to "include/${PROJECT_NAME}/${PROJECT_NAME}" and calls ament_export_include_directories("include/${PROJECT_NAME}") to export the parent of install destination.

Would it be possible to give developers more control over these paths?
E.g rosidl_generate_interfaces(${PROJECT_NAME} INSTALL_ROOT "include" ...)

Example case

Consider an ament package with the default structure of ros2 pkg create

my_package
 include/my_package/
  my_header.h
 CMakeLists.txt
 package.xml

And the simplest install & export directives in CMakeLists.txt corresponding to exporting all headers of the package:

install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/my_package DESTINATION include
ament_export_include_directories(include)

so that other packages may access "my_package/my_header.h".

When generated interfaces are added using rosidl_generate_interfaces, the resulting installation structure looks like this:

 include/my_package/
  my_header.h
  my_package/
   msg/
   srv/

If there would be an option to specify install path (i.e. override include/${PROJECT_NAME}/${PROJECT_NAME} with include/${PROJECT_NAME}), one could create a cleaner install structure:

 include/my_package/
  my_header.h
  msg/
  srv/

I understand, that one could use the SKIP_INSTALL option of rosidl_generate_interfaces, but then replicating the install steps is tedious.
I also realize, that the unique directory was needed due to #670

Thank you for your comments & thoughts in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions