Skip to content

[configuration and compilation] Using GNUInstallDirs to determine installation locations? #5496

Open
@waebbl

Description

@waebbl

Is your feature request related to a problem? Please describe.

We received a bug report on Gentoo Linux for files not installed to FHS compliant directories[1], related to documentation files. During my research, I noticed that the cmake config files are installed under /usr/share/pcl-1.12 which is also an unusual directory for this, which could lead to issues, see for example #4661. Many Linux distributions use /usr/lib*/cmake/<package> or /usr/share/cmake/<package> for lib-agnostic cmake config and modules files.

[1] https://bugs.gentoo.org/853886

Context

Having a mechanism for a unified installation, which keeps to general standards (FHS) would improve the project. The GNUInstallDirs cmake mechanism ensures that sensible default values for all platforms are chosen.

Expected behavior

Independently of the used platform or distribution, the installation directories should comply with the defined standards.

Current Behavior

Depending on the distribution used, some files might get installed into directories which are not covered by standards.

Describe the solution you'd like

I will provide a PR for you to consider, which uses GNUInstallDirs and some additional guards in pcl_utils.cmake.

Describe alternatives you've considered

Adding more guards to the SET_INSTALL_DIRS function, without using GNUInstallDirs, so the installation directories can be passed on the cmake command line. This is implemented in my PR in addition to using GNUInstallDirs.

Additional context

The patch of the cmake config files is hardcoded in the PCLConfig.cmake.in file and I have adapted it in my PR. It should, however, be possible to use the CMakePackageConfigHelpers module to ease the process of creating cmake files for the package and avoid hardcoding any paths. The module will take care of using the correct paths. My PR doesn't cover using this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions