Skip to content

Cmake fixes - #219

Merged
nmoinvaz merged 2 commits into
zlib-ng:masterfrom
mikecrowe:cmake-fixes
Jan 4, 2018
Merged

nmoinvaz merged 2 commits into
zlib-ng:masterfrom
mikecrowe:cmake-fixes

Conversation

@mikecrowe

Copy link
Copy Markdown
Contributor

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.

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.
@nmoinvaz
nmoinvaz merged commit a6e3b69 into zlib-ng:master Jan 4, 2018
@nmoinvaz

nmoinvaz commented Jan 4, 2018

Copy link
Copy Markdown
Member

Looks good thanks for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants