I don't yet have a REP or an end-to-end demonstration of what is being achieved here, but the changes as they stand should be a no-op, as I believe we're just using standard variables whose default values are what was previously hard-coded. See:
I'm testing with CMake 3.16.3 (Ubuntu Focal), but the documentation referenced is 3.0 as that's what catkin's minimum version is currently set at, and I don't want to bump that unless there's good reason to do so.
I've confirmed that catkin itself still builds, of course, and I've spot-checked a handful of small packages early in the dependency tree, for example:
In the Nix case (which is what I actually care about here), the CMake and pkgconfig files can be safely relocated after build to the dev output (equivalent of a debian libfoo-dev package) and they will still be able to find their libraries since they have been generated with absolute paths to them.
Remaining tasks before merging this:
[ ] Build at least to ros-base using catkin-tools, before and after this change, validate all generated CMake config changes are reasonable.
[ ] The same, but with the devel- rather than installspaces.
[ ] Decide if we like the <pkgname>_INSTALL_XXDIR naming (which is meant to ape what GNUInstallDirs looks like), or if it would make more sense to follow the <pkgname>_DIR convention already in use in a number of places (examples: ROS 1, ROS 2).
[ ] Decide if finding of package.xml files will be part of this change or a separate one (they have a similar issue to libraries in that they are no longer findable relative to the CMake config, since they're part of the runtime split).
[ ] Implement at least some of the companion changes in other packages to properly consume the new <pkg>_INSTALL_LIBDIR and <pkg>_INSTALL_DATADIR variables from their "extras" templates.
This is obviously a package that has to be modified pretty conservatively, so I'm open to suggestions for other means of validating this change and ensuring that it is safe.
An initial piece of this much larger proposal.
I don't yet have a REP or an end-to-end demonstration of what is being achieved here, but the changes as they stand should be a no-op, as I believe we're just using standard variables whose default values are what was previously hard-coded. See:
https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html
I'm testing with CMake 3.16.3 (Ubuntu Focal), but the documentation referenced is 3.0 as that's what catkin's minimum version is currently set at, and I don't want to bump that unless there's good reason to do so.
I've confirmed that catkin itself still builds, of course, and I've spot-checked a handful of small packages early in the dependency tree, for example:
In the Nix case (which is what I actually care about here), the CMake and pkgconfig files can be safely relocated after build to the
dev
output (equivalent of a debianlibfoo-dev
package) and they will still be able to find their libraries since they have been generated with absolute paths to them.Remaining tasks before merging this:
<pkgname>_INSTALL_XXDIR
naming (which is meant to ape what GNUInstallDirs looks like), or if it would make more sense to follow the<pkgname>_DIR
convention already in use in a number of places (examples: ROS 1, ROS 2).package.xml
files will be part of this change or a separate one (they have a similar issue to libraries in that they are no longer findable relative to the CMake config, since they're part of the runtime split).<pkg>_INSTALL_LIBDIR
and<pkg>_INSTALL_DATADIR
variables from their "extras" templates.This is obviously a package that has to be modified pretty conservatively, so I'm open to suggestions for other means of validating this change and ensuring that it is safe.