-
Notifications
You must be signed in to change notification settings - Fork 96
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
Fixes for packaging on GNU/Unix like systems #181
Merged
Merged
Conversation
This file contains 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
Add support to build using cmake config files installed by libzip. Add and option that controls if config mode is to be used, this is on per default on non windows systems. The package name used by libzip is libzip not LIBZIP so add a variable that holds this and use it where needed in CMakeLists.txt and Config.cmake.in. FindLIBZIP.cmake is unneeded in config mode so don't install it if config mode is used. This commit also includes changes due to line endings. This the editor that saves in \n instead of \r\n.
Update the project version to the latest released version. While doing that set description, homepage and language. This project only uses C++.
Add an option that enables use of GNUInstallDirs. Set its default value to ON on unix-like systems. When the option is off files are installed into the same locations as before. Remove the DESTINATION arguments from install, these have default values that are the same as the ones used with or without GNUIinstallDirs then using cmake 3.14 and above, up the least required cmake version to 3.14 due to this. Install cmake config files into libdir/cmake when using GNUInstalldirs instead of share/libzipp since libzippp is not a header only library.
Add pkg-config file generation. In order to generate the right values in the pkg-config file GNUInstallDirs has to be used. The pkg-config file in only relevant for development so only install it when the header is installed, it also uses the name of the shared lib for linking so only install it when the shared lib is built.
FreeBSD native packages put pkg-config files in libdata/pkgconfig so add it to PATH_SUFFIXES. Some find_package calls have the imported targets as argument where the module name is to be used, fix this. Change lgnutls to -lnettle since this is probably what is intended since the statements below it concerns the nettle library. Bump the required version of cmake to version 3.16 since the GnuTLS::GnuTLS imported target is only available in cmake 3.16 and later.
Use std::*_t types on non-win32 platforms to get the correct bit widths, long int is for example 32 bits on 32-bit FreeBSD and 32-bit Linux systems.
…LDIRS Set default OFF for LIBZIPPP_CMAKE_CONFIG_MODE and LIBZIPPP_GNUINSTALLDIRS this is since they can cause some trouble in some configurations. If someone is including libzippp into their project using add_subdirectory then they might not want GNUInstallDirs included in their project even if they build on unix-like machines. These options are mostly for GNU/Unix packagers anyway.
Seems to be complicated to make INSTALL_INTERFACE handle generator expressions correctly so use if and set instead to get the right include directory.
@niclasr Thanks for the PR, this is amazing work ! I'm not familiar at all with CMake, but LGTM. |
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.
Hi here are some fixes for packaging on GNU/Unix-like systems. It also fixes #97, that I have also come across when packaging libzippp for pkgsrc-wip. It also includes libzippp_int fixes for GNU/Unix-like systems, long int is 32-bits on 32bit FreeBSD and Linux. Mentioning @yurivict due to #97 and @vicroms since I hope this doesn't break anything for the vcpkg build.