diff options
author | Domen Vrankar <domen.vrankar@gmail.com> | 2016-09-04 19:13:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-05 13:24:45 (GMT) |
commit | 4ffdd564eb32be6147cb8610bbf6c0b5496fc56a (patch) | |
tree | f15bb299a1e067e7396cdfe33924a85116348a4b /Modules/CPackDeb.cmake | |
parent | fb357e5fef2e7803f2f745b6aa4cf63935628ed6 (diff) | |
download | CMake-4ffdd564eb32be6147cb8610bbf6c0b5496fc56a.zip CMake-4ffdd564eb32be6147cb8610bbf6c0b5496fc56a.tar.gz CMake-4ffdd564eb32be6147cb8610bbf6c0b5496fc56a.tar.bz2 |
CPack/DEB: Add option to select archive type
Add a `CPACK_DEBIAN_ARCHIVE_TYPE` option that can be used to select an
archive type that supports long file names.
Closes: #14332
Diffstat (limited to 'Modules/CPackDeb.cmake')
-rw-r--r-- | Modules/CPackDeb.cmake | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake index c9678d6..1a7b923 100644 --- a/Modules/CPackDeb.cmake +++ b/Modules/CPackDeb.cmake @@ -177,6 +177,24 @@ # # See https://www.debian.org/doc/debian-policy/ch-archive.html#s-subsections # +# .. variable:: CPACK_DEBIAN_ARCHIVE_TYPE +# +# The archive format used for creating the Debian package. +# +# * Mandatory : YES +# * Default : "paxr" +# +# Possible values are: +# +# - paxr +# - gnutar +# +# .. note:: +# +# Default pax archive format is the most portable format and generates +# packages that do not treat sparse files specially. +# GNU tar format on the other hand supports longer filenames. +# # .. variable:: CPACK_DEBIAN_COMPRESSION_TYPE # # The compression used for creating the Debian package. @@ -842,12 +860,24 @@ function(cpack_deb_prepare_package_vars) set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") endif() + if(CPACK_DEBIAN_ARCHIVE_TYPE) + set(archive_types_ "paxr;gnutar") + cmake_policy(PUSH) + cmake_policy(SET CMP0057 NEW) + if(NOT CPACK_DEBIAN_ARCHIVE_TYPE IN_LIST archive_types_) + message(FATAL_ERROR "CPACK_DEBIAN_ARCHIVE_TYPE set to unsupported" + "type ${CPACK_DEBIAN_ARCHIVE_TYPE}") + endif() + cmake_policy(POP) + else() + set(CPACK_DEBIAN_ARCHIVE_TYPE "paxr") + endif() + # Compression: (recommended) if(NOT CPACK_DEBIAN_COMPRESSION_TYPE) set(CPACK_DEBIAN_COMPRESSION_TYPE "gzip") endif() - # Recommends: # You should set: CPACK_DEBIAN_PACKAGE_RECOMMENDS @@ -1000,6 +1030,7 @@ function(cpack_deb_prepare_package_vars) set(GEN_CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_DEBIAN_PACKAGE_MAINTAINER}" PARENT_SCOPE) set(GEN_CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_DEBIAN_PACKAGE_DESCRIPTION}" PARENT_SCOPE) set(GEN_CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}" PARENT_SCOPE) + set(GEN_CPACK_DEBIAN_ARCHIVE_TYPE "${CPACK_DEBIAN_ARCHIVE_TYPE}" PARENT_SCOPE) set(GEN_CPACK_DEBIAN_COMPRESSION_TYPE "${CPACK_DEBIAN_COMPRESSION_TYPE}" PARENT_SCOPE) set(GEN_CPACK_DEBIAN_PACKAGE_RECOMMENDS "${CPACK_DEBIAN_PACKAGE_RECOMMENDS}" PARENT_SCOPE) set(GEN_CPACK_DEBIAN_PACKAGE_SUGGESTS "${CPACK_DEBIAN_PACKAGE_SUGGESTS}" PARENT_SCOPE) |