diff options
author | Adriaan de Groot <groot@kde.org> | 2017-02-12 16:48:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-06-10 11:53:59 (GMT) |
commit | 2042cae9a5d9bb2f71a715022a4b6a7416c8e9e3 (patch) | |
tree | c164e350b033a26667041234f9979dd1e0707e66 /Modules/CPack.cmake | |
parent | c095e90f3af78fb3421c80b725ebc6ad9ec85999 (diff) | |
download | CMake-2042cae9a5d9bb2f71a715022a4b6a7416c8e9e3.zip CMake-2042cae9a5d9bb2f71a715022a4b6a7416c8e9e3.tar.gz CMake-2042cae9a5d9bb2f71a715022a4b6a7416c8e9e3.tar.bz2 |
CPack-FreeBSD: add a generator for FreeBSD pkg(8)
Adds an option CPACK_ENABLE_FREEBSD_PKG to allow CPack to look
for FreeBSD's libpkg / pkg(8). If this is set and the libpkg
headers and library are found (which they will be, by default,
on any FreeBSD system), then add a FreeBSD pkg(8) generator.
The FreeBSD package tool pkg(8) uses tar.xz files (.txz) with two
metadata files embedded (+MANIFEST and +COMPACT_MANIFEST).
This introduces a bunch of FreeBSD-specific CPACK_FREEBSD_PACKAGE_*
variables for filling in the metadata; the Debian generator does
something similar. Documentation for the CPack CMake-script is styled
after the Debian generator.
Implementation notes:
- Checks for libpkg -- the underlying implementation for pkg(8) --
and includes FreeBSD package-generation if building CMake on
a UNIX host. Since libpkg can be used on BSDs, Linux and OSX,
this potentially adds one more packaging format. In practice,
this will only happen on FreeBSD and DragonflyBSD.
- Copy-paste from cmCPackArchiveGenerator to special-case
the metadata generation and to run around the internal
archive generation: use libpkg instead.
- Generating the metadata files is a little contrived.
- Most of the validation logic for package settings is in
CPackFreeBSD.cmake, as well as the code that tries to re-use
packaging settings that may already be set up for Debian.
- libpkg has its own notion of output filename, so we have
another contrived bit of code that munges the output file
list so that CPack can find the output.
- Stick with C++98.
Diffstat (limited to 'Modules/CPack.cmake')
-rw-r--r-- | Modules/CPack.cmake | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index a63fc83..3915943 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -471,6 +471,7 @@ if(NOT CPACK_GENERATOR) option(CPACK_BINARY_TZ "Enable to build TZ packages" ON) endif() option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF) + option(CPACK_BINARY_FREEBSD "Enable to build FreeBSD packages" OFF) option(CPACK_BINARY_NSIS "Enable to build NSIS packages" OFF) option(CPACK_BINARY_RPM "Enable to build RPM packages" OFF) option(CPACK_BINARY_STGZ "Enable to build STGZ packages" ON) @@ -491,6 +492,7 @@ if(NOT CPACK_GENERATOR) cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_CYGWIN CygwinBinary) cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DEB DEB) cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DRAGNDROP DragNDrop) + cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_FREEBSD FREEBSD) cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_IFW IFW) cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_NSIS NSIS) cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_OSXX11 OSXX11) @@ -542,6 +544,7 @@ mark_as_advanced( CPACK_BINARY_CYGWIN CPACK_BINARY_DEB CPACK_BINARY_DRAGNDROP + CPACK_BINARY_FREEBSD CPACK_BINARY_IFW CPACK_BINARY_NSIS CPACK_BINARY_OSXX11 |