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

Fixes for packaging on GNU/Unix like systems #181

Merged
merged 10 commits into from
Jan 30, 2023
Merged

Conversation

niclasr
Copy link
Contributor

@niclasr niclasr commented Jan 24, 2023

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.

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.
@ctabin
Copy link
Owner

ctabin commented Jan 27, 2023

@niclasr Thanks for the PR, this is amazing work ! I'm not familiar at all with CMake, but LGTM.

@ctabin ctabin merged commit 3874125 into ctabin:master Jan 30, 2023
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.

Could NOT find LIBZIP (missing: _libzip_pkgcfg)
2 participants