Fix cmake/pkgconfig install directories#343
Open
kirelagin wants to merge 3 commits intoemil-e:masterfrom
Open
Conversation
The header files were installed into `${CMAKE_INSTALL_INCLUDEDIR}`
(correct), but the exported target was using a hardcoded `include` path
for its headers location in its install interface.
Set the directory in the target’s interface to where the headers are
actually being installed.
This will result in the exact same behaviour as before, if
`${CMAKE_INSTALL_INCLUDEDIR}` is not overriden, as it defaults to
`include`. However, when it was overriden, the resulting CMake config
was unusable, and this fixes it.
The .pc file was using hardcoded installdir and libdir locations, even though the headers were actually installed into their respective GNU dirs, which can be overriden by the user. Use the appropriate variables instead of the harcoded paths, and also clean up the file a bit to remove an extra layer of unnecessary variables in the CMake file.
Previously, the CMake config files for the package were installed into `share/cmake`. This location is usually reserved for CMake-specific modules/macros etc. Install to `lib/cmake` instead, to be consistent with the location of the `.pc` file, and also switch to using the corresponding GNU libdir variable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix and clean up the CMake config and the generated
.pcfile. This is necessary, in particular, in situations when the.solibrary and the headers are installed into different prefix directories.