Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Gyebro opened this issue Nov 25, 2024 · 1 comment
Open

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

Gyebro opened this issue Nov 25, 2024 · 1 comment
Labels
more-information-needed Further information is required

Comments

@Gyebro
Copy link

Gyebro commented Nov 25, 2024

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.

@clalancette
Copy link
Contributor

I also realize, that the unique directory was needed due to #670

I'm not sure that this is a good idea, precisely because of #670 . Is there any particular reason you can't use the current structure?

@MichaelOrlov MichaelOrlov added the more-information-needed Further information is required label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-information-needed Further information is required
Projects
None yet
Development

No branches or pull requests

3 participants