pcl
pcl copied to clipboard
Use GNUInstallDirs to set installation locations
The use of GNUInstallDirs ensures, the files are installed in common locations on all platforms.
Closes: https://github.com/PointCloudLibrary/pcl/issues/5496 Signed-off-by: Bernd Waibel [email protected]
I'm not that known to linux directory structure, but it seems to be the default to use GNUInstallDirs. So looks good to me.
This change would be nice to get merged, as using GNUInstallDirs simplifies the split output story for packaging in Nix. One additional piece could be to eliminate the use of the PCL_ROOT variable altogether, particularly in blocks like this one:
https://github.com/PointCloudLibrary/pcl/blob/aa7c6795227d443fe22355d1fac4c5afe7d51274/PCLConfig.cmake.in#L408-L426
Rather than assuming the built libraries are relative to some common root in the installed case, as this line does:
set(PCL_LIBRARY_DIRS "${PCL_ROOT}/@LIB_INSTALL_DIR@")
I believe it would be preferred to use the CMAKE_INSTALL_LIBDIR variable here, which CMake provides via its GNUInstallDirs implementation.
See: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
@jspricke and @UnaNancyOwen Can you chime in on this change how it would work on debian and windows?
@larshg I checked this changes. It almost works fine on Windows and All-in-one Installer! 👍
For one thing from me, the installation directory path of the documentations seems to be just a little different from the path required by the generate script for all-in-one installer. Therefore, the link set by installer is broken. Perhaps, it should be corrected on these lines. https://github.com/PointCloudLibrary/pcl/blob/18fe557eb3b5ef568da024d071923d49222cb3ba/cmake/cpack_options.cmake.in#L18-L22
pcl-@PCL_VERSION_MAJOR@.@PCL_VERSION_MINOR@ -> PCL
set(CPACK_NSIS_MENU_LINKS
- "share/doc/pcl-@PCL_VERSION_MAJOR@.@PCL_VERSION_MINOR@/tutorials/html/index.html" "Tutorials"
- "share/doc/pcl-@PCL_VERSION_MAJOR@.@PCL_VERSION_MINOR@/tutorials/html/sources" "Tutorials sources"
- "share/doc/pcl-@PCL_VERSION_MAJOR@.@PCL_VERSION_MINOR@/html/pcl-@PCL_VERSION_MAJOR@.@[email protected]" "Documentation"
+ "share/doc/PCL/tutorials/html/index.html" "Tutorials"
+ "share/doc/PCL/tutorials/html/sources" "Tutorials sources"
+ "share/doc/PCL/html/pcl-@PCL_VERSION_MAJOR@.@[email protected]" "Documentation"
"http://www.pointclouds.org" "PCL Website")
fine with me.