Repository navigation
Cmake fixes - #219
Merged
Merged
Cmake fixes#219
Conversation
CMake's GNUInstallDirs knows where particular Linux architectures and distributions want to have their libraries installed. In particular, Debian-derived "multi-arch" distributions keep their libraries in triplet sudirectories under /lib. Other "bi-arch" distributions keep 64-bit libraries in /lib64. Including GNUInstallDirs and using CMAKE_INSTALL_ variables means that minizip's libraries and header files are installed in the correct locations. For GNUInstallDirs to work, CMAKE_SYSTEM_NAME needs to be set which only appears to be the case after the project command so this must be moved earlier. Also, since minizip is compiled, its pkgconfig file should be in the architecture-specific "lib" rather than the architecture-independent "share" directory. Tested with OpenEmbedded and on Debian GNU/Linux 9.3 (the special naming only applies when installing in /usr.)
…figuration
The existing CMakeLists.txt installed the minizip cmake configuration files
in PREFIX/cmake which doesn't match where other packages install such
files.
Let's add a INSTALL_CMAKE_DIR so that the destination can be specified, and
then default to installing in the standard ${CMAKE_INSTALL_LIBDIR}/cmake
location which should end up being the right place.
Tested with OpenEmbedded and on Debian GNU/Linux 9.3.
Member
|
Looks good thanks for the contribution. |
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.
These fixes should make it easier to install minizip as a system library on Linux. I'm not sure what effect they will have on Windows or MacOS, but I would hope that GNUInstallDirs does something sensible there.