PointCloudLibrary / PointCloudLibrary/pcl

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

Open
#5,496 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind: request status: triage
Dominant language
C++
Stars
11.1k
Forks
4.7k
Avg merge
4d 10h
Merged PRs (30d)
6

Description

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 https://github.com/PointCloudLibrary/pcl/issues/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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the installation logic in pcl_utils.cmake and the paths hardcoded in PCLConfig.cmake.in. Compare the current locations with GNUInstallDirs and the platform standards described in the issue, including the CMake package configuration location. Done means installation paths can be configured consistently and no longer place files in the reported nonstandard directories.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.