You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a proposal to adopt GNUInstallDirs in ROS 2 CMake and a minimum CMake 3.14 version in the core ROS libraries.
Advantages
GNUInstallDirs is intended to be a platform-portable to manage installation of libraries, includes, and executables. Since they are standard CMake variables, this allows packaging maintainers rather than library authors to be responsible for handling platform-specific installation needs. An example of one such need is explained here for colcon, which was a behavior changed in humble, documented in the humble changelog, missed in the ament documentation, and confusing for library authors like myself.
GNUInstallDirs gives more flexibility to package maintainers, without burdening library authors with having to remember ROS specific ways to install a ROS package that only affect packaging.
Risks
It would result in code churn in the following places
install(
TARGETS${PROJECT_NAME}EXPORT${PROJECT_NAME}ARCHIVEDESTINATION lib
LIBRARYDESTINATION lib
RUNTIMEDESTINATION bin
)
Desired Behavior
target_include_directories(some_library_in_foo INTERFACE"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")
include(GNUInstallDirs)
install(DIRECTORY include/ DESTINATION${CMAKE_INSTALL_INCLUDEDIR})
install(
TARGETS${PROJECT_NAME}EXPORT${PROJECT_NAME}# Nodes must be installed here for ROS 2 CLI to recognize themRUNTIMEDESTINATION${CMAKE_INSTALL_LIBDIR}INCLUDESDESTINATION${CMAKE_INSTALL_INCLUDEDIR}
)
Note how now that library authors do not have to care about colcon wanting the debian binary includes to show up in /opt/ros/humble/include/${PROJECT_NAME}/${PROJECT_NAME}, it's the responsibility of the packaging system (bloom) to deal with this by setting CMAKE_INSTALL_INCLUDEDIR to include/${PROJECT_NAME}.
Implementation considerations
There are notes of issues on rhel and Windows with GNUInstallDirs.
Also, if ROS users can use CMake 3.23, which will happen in J-turtle, then FILE_SETS are the preferred route according to Craig Scott's book Professional CMake, however GNUInstallDirs is still used then.
Proposed order of operations
Review/modify/accept the proposal
Generate a proof of concept that can be tested on humble distros, including windows and rhel.
According to :
Update the core libraries
Then, update the docs after the core per @clalancette
Update ROS2 CLI
ROS discourse announcement for other ROS library authors and package maintainers?
Feature request
This is a proposal to adopt GNUInstallDirs in ROS 2 CMake and a minimum CMake 3.14 version in the core ROS libraries.
Advantages
GNUInstallDirs is intended to be a platform-portable to manage installation of libraries, includes, and executables. Since they are standard CMake variables, this allows packaging maintainers rather than library authors to be responsible for handling platform-specific installation needs. An example of one such need is explained here for colcon, which was a behavior changed in
humble
, documented in the humble changelog, missed in the ament documentation, and confusing for library authors like myself.GNUInstallDirs gives more flexibility to package maintainers, without burdening library authors with having to remember ROS specific ways to install a ROS package that only affect packaging.
Risks
It would result in code churn in the following places
ros2 pkg create
There are hints it might not work out of the box on Windows and RHEL.
Current Behavior
This comes from colcon's documentation:
And, then from rclcpp's install
Desired Behavior
Note how now that library authors do not have to care about colcon wanting the debian binary includes to show up in
/opt/ros/humble/include/${PROJECT_NAME}/${PROJECT_NAME}
, it's the responsibility of the packaging system (bloom) to deal with this by settingCMAKE_INSTALL_INCLUDEDIR
toinclude/${PROJECT_NAME}
.Implementation considerations
There are notes of issues on rhel and Windows with GNUInstallDirs.
Also, if ROS users can use CMake 3.23, which will happen in J-turtle, then FILE_SETS are the preferred route according to Craig Scott's book Professional CMake, however GNUInstallDirs is still used then.
Proposed order of operations
According to :
Related
ros2/ros2_documentation#3805
ros2/ros2cli#845
The text was updated successfully, but these errors were encountered: