Skip to content
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

cmake: make install path configurable #1174

Merged
merged 5 commits into from
Oct 8, 2024
Merged

Conversation

junghans
Copy link
Contributor

@junghans junghans commented Oct 5, 2024

Making CMake install locations configurable.

I also changed the default for the CMake Target files to share instead of libdir as the library is header-only and arch-independent.

@aprokop
Copy link
Contributor

aprokop commented Oct 5, 2024

@junghans Thank you for the contribution!

I'm not really familiar with GNUInstallDirs. When is it useful? Was the current state insufficient for your needs?

Not sure about share/, as my understanding is that it is mostly where documentation, fonts, etc go. For a library, I would not expect it to be found there. Otherwise, it looks fine to me.

@aprokop aprokop added the build Build and installation label Oct 5, 2024
@junghans
Copy link
Contributor Author

junghans commented Oct 5, 2024

I'm not really familiar with GNUInstallDirs. When is it useful? Was the current state insufficient for your needs?

The issue was that things got installed in lib and not lib64, which should be the default for 64-bit system, using GNUInstallDirs instead of a hard-coded lib will fix that.

Not sure about share/, as my understanding is that it is mostly where documentation, fonts, etc go. For a library, I would not expect it to be found there.

CMake is looking into <prefix>/(lib/<arch>|lib*|share)/cmake/<name>*/
(See https://cmake.org/cmake/help/latest/command/find_package.html) so it shouldn't matter much and as your target files are architecture independent share seems the better place.

@aprokop
Copy link
Contributor

aprokop commented Oct 5, 2024

it shouldn't matter much and as your target files are architecture independent share seems the better place.

The way I read the Filesystem Hierarchy Standard, share is for non-modifiable data files only, not code:

The /usr/share hierarchy is for all read-only architecture independent data files.

Is there an example of a library that installs code headers in /usr/share or similar?

@junghans
Copy link
Contributor Author

junghans commented Oct 5, 2024

it shouldn't matter much and as your target files are architecture independent share seems the better place.

The way I read the Filesystem Hierarchy Standard, share is for non-modifiable data files only, not code:

The /usr/share hierarchy is for all read-only architecture independent data files.

Is there an example of a library that installs code headers in /usr/share or similar?

Sorry, it is not about the headers, I only want to change the default for the CMake files from lib to share. Headers go into include by default, are configurable now.

CMakeLists.txt Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@junghans
Copy link
Contributor Author

junghans commented Oct 8, 2024

@aprokop I went for the minimal version, as ${CMAKE_INSTALL_DATADIR} is only used for the CMake Modules, one can always just change that default.

@aprokop
Copy link
Contributor

aprokop commented Oct 8, 2024

@aprokop I went for the minimal version, as ${CMAKE_INSTALL_DATADIR} is only used for the CMake Modules, one can always just change that default.

This last change goes against what @dalg24 wanted, I think, in that the default location for the cmake/ is now share instead of lib.

@junghans
Copy link
Contributor Author

junghans commented Oct 8, 2024

@aprokop I went for the minimal version, as ${CMAKE_INSTALL_DATADIR} is only used for the CMake Modules, one can always just change that default.

This last change goes against what @dalg24 wanted, I think, in that the default location for the cmake/ is now share instead of lib.

@dalg24 Does https://discourse.cmake.org/t/what-should-the-destination-be-for-a-header-only-librarys-cmake-config-file/8473 convince you to go with share as a default?

@dalg24
Copy link
Contributor

dalg24 commented Oct 8, 2024

I don't care too much as long as it is the search paths constructed for both Windows and Unix which both lib* and share are

CMakeLists.txt Outdated Show resolved Hide resolved
@aprokop
Copy link
Contributor

aprokop commented Oct 8, 2024

Build errors are unrelated.

@aprokop aprokop merged commit 03f2007 into arborx:master Oct 8, 2024
1 of 2 checks passed
@aprokop
Copy link
Contributor

aprokop commented Oct 8, 2024

@junghans Thank you for your contribution and patience.

@aprokop aprokop mentioned this pull request Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build and installation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants