-
Notifications
You must be signed in to change notification settings - Fork 106
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
Make $<INSTALL_INTERFACE... use INCLUDE_INSTALL_DIR, and install headers to include/${PROJECT_NAME} #120
Make $<INSTALL_INTERFACE... use INCLUDE_INSTALL_DIR, and install headers to include/${PROJECT_NAME} #120
Conversation
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
I forgot a trailing slash, so I pushed a new commit fixing it. |
See this answer. |
Signed-off-by: Shane Loretz <[email protected]>
Signed-off-by: Shane Loretz <[email protected]>
After reviewing the ros2 issue I understand why you require these changes and how they work, but I don't think this is the way to go. In the issue I've proposed an alternative solution that only requires modifying colcon behavior to make it more CMake consistent and robust. I'm open to whatever the ROS2 community decides on this subject, thus the pull request will remain open until |
set(BIN_INSTALL_DIR bin/ CACHE PATH "Installation directory for binaries") | ||
set(INCLUDE_INSTALL_DIR include/ CACHE PATH "Installation directory for C++ headers") | ||
set(_include_dir "include/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We used to unset
auxiliary variables like _include_dir
when are no longer necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unset _include_dir
in 0e54e5d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The merit of these changes for ROS2 ecosystem have been justified on the associated issue.
LGTM
Signed-off-by: Shane Loretz <[email protected]>
Note that these changes are required also in dependencies solved via vendor packages.
|
Good news, the |
Right!!! 😎 Jonathan is no fool and has saved us some work 🎉 |
eProsima/Fast-DDS#2535 eProsima/Fast-CDR#120 This is in support of ros2/ros2#1150 Signed-off-by: Shane Loretz <[email protected]>
eProsima/Fast-DDS#2535 eProsima/Fast-CDR#120 This is in support of ros2/ros2#1150 Signed-off-by: Shane Loretz <[email protected]>
eProsima/Fast-DDS#2535 eProsima/Fast-CDR#120 This is in support of ros2/ros2#1150 Signed-off-by: Shane Loretz <[email protected]>
The first commit is a bug fix. The exported targets currently always say the include directory is
include/
regardless ofINCLUDE_INSTALL_DIR
.The second commit is an enhancement supporting ros2/ros2#1150. When using ROS 2 and Colcon it's possible to have two versions of a package installed: typically one from the debian packages (like
ros-[rosdistro]-fastcdr
) and another in a from-source workspace. In Colcon terms this is called "overriding a package", and the/opt/ros/[rosdistro]
folder would be called the underlay while the from-source workspace would be called the overlay. A user would do this when they want to try a newer version of a package without building everything from source.When two or more packages install their headers to the same directory in an underlay, it becomes possible for packages in the overlay to accidentally find the headers of an overridden package in the underlay. This can cause build failures or undefined behavior at runtime depending on the differences between the headers in the overridden and overriding packages. The exact conditions this happens are a little complicated, so I'll skip writing it out here. In ROS 2 we're solving the issue by making every package install its headers to a unique folder using
${PROJECT_NAME}
. That's what the second commit does here.