diff options
author | Brad King <brad.king@kitware.com> | 2024-07-02 12:26:41 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-07-02 12:27:09 (GMT) |
commit | 1582aba95e64db89fdd51f46e52a476d38c65ec6 (patch) | |
tree | 56f1c61506d2d54a35d088f2ac74562908e8a6f6 | |
parent | 40ed14a88b21385daebf9526904d3b09731216fb (diff) | |
parent | fab5c030ad5e8fa30cfd407b0e440e05ca091559 (diff) | |
download | CMake-1582aba95e64db89fdd51f46e52a476d38c65ec6.zip CMake-1582aba95e64db89fdd51f46e52a476d38c65ec6.tar.gz CMake-1582aba95e64db89fdd51f46e52a476d38c65ec6.tar.bz2 |
Merge topic 'cpack-rpm-zstd-compression'
fab5c030ad CPack/RPM: Add zstd compression support
a25be17bc4 CPack/RPM: emit error on invalid CPACK_RPM_COMPRESSION_TYPE
7e21412f47 CPack/RPM: fix whitespace alignment prior to editing
e0b73a32c1 Help: Clarify using CPACK_THREADS as default
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9632
-rw-r--r-- | Help/cpack_gen/archive.rst | 8 | ||||
-rw-r--r-- | Help/cpack_gen/rpm.rst | 10 | ||||
-rw-r--r-- | Help/release/dev/cpack-rpm-zstd.rst | 5 | ||||
-rw-r--r-- | Modules/Internal/CPack/CPackRPM.cmake | 45 |
4 files changed, 39 insertions, 29 deletions
diff --git a/Help/cpack_gen/archive.rst b/Help/cpack_gen/archive.rst index 7f7921d..5836f91 100644 --- a/Help/cpack_gen/archive.rst +++ b/Help/cpack_gen/archive.rst @@ -91,14 +91,10 @@ CPack generators which are essentially archives at their core. These include: .. versionadded:: 3.18 - :Default: ``1`` + :Default: value of :variable:`CPACK_THREADS` If set to ``0``, the number of available cores on the machine will be used instead. - The default is ``1`` which limits compression to a single thread. Note that - not all compression modes support threading in all environments. Currently, - only the XZ compression may support it. - - See also the :variable:`CPACK_THREADS` variable. + Note that not all compression modes support threading in all environments. .. versionadded:: 3.21 diff --git a/Help/cpack_gen/rpm.rst b/Help/cpack_gen/rpm.rst index 4a2ce5f..ebd3766 100644 --- a/Help/cpack_gen/rpm.rst +++ b/Help/cpack_gen/rpm.rst @@ -246,9 +246,8 @@ List of CPack RPM generator specific variables: :Default: (system default) May be used to override RPM compression type to be used to build the - RPM. For example some Linux distribution now default to ``lzma`` or ``xz`` - compression whereas older cannot use such RPM. Using this one can enforce - compression type to be used. + RPM. For example some Linux distributions default to ``xz`` or ``zstd``. + Using this, one can specify a specific compression type to be used. Possible values are: @@ -264,6 +263,11 @@ List of CPack RPM generator specific variables: ``gzip`` GNU Gzip compression + ``zstd`` + .. versionadded:: 3.31 + + Zstandard compression + .. variable:: CPACK_RPM_PACKAGE_AUTOREQ CPACK_RPM_<component>_PACKAGE_AUTOREQ diff --git a/Help/release/dev/cpack-rpm-zstd.rst b/Help/release/dev/cpack-rpm-zstd.rst new file mode 100644 index 0000000..828d5f6 --- /dev/null +++ b/Help/release/dev/cpack-rpm-zstd.rst @@ -0,0 +1,5 @@ +cpack-rpm-zstd +-------------- + +* The :cpack_gen:`CPack RPM Generator` gained support for ``zstd`` as a + :variable:`CPACK_RPM_COMPRESSION_TYPE` value. diff --git a/Modules/Internal/CPack/CPackRPM.cmake b/Modules/Internal/CPack/CPackRPM.cmake index 4a741ee..e3f8f5e 100644 --- a/Modules/Internal/CPack/CPackRPM.cmake +++ b/Modules/Internal/CPack/CPackRPM.cmake @@ -1034,27 +1034,32 @@ function(cpack_rpm_generate_package) # CPACK_RPM_COMPRESSION_TYPE # if (CPACK_RPM_COMPRESSION_TYPE) - if(CPACK_RPM_PACKAGE_DEBUG) - message("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}") - endif() - if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma") - set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio") - endif() - if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz") - if(CPACK_THREADS GREATER "0") - set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7T${CPACK_THREADS}.xzdio") - else() - set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7T.xzdio") - endif() - endif() - if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2") - set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio") - endif() - if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip") - set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio") - endif() + if(CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}") + endif() + if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma") + set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio") + elseif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz") + if(CPACK_THREADS GREATER "0") + set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7T${CPACK_THREADS}.xzdio") + else() + set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7T.xzdio") + endif() + elseif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2") + set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio") + elseif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip") + set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio") + elseif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "zstd") + if(CPACK_THREADS GREATER "0") + set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w19T${CPACK_THREADS}.zstdio") + else() + set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w19T0.zstdio") + endif() + else() + message(FATAL_ERROR "Specified CPACK_RPM_COMPRESSION_TYPE value is not supported: ${CPACK_RPM_COMPRESSION_TYPE}") + endif() else() - set(CPACK_RPM_COMPRESSION_TYPE_TMP "") + set(CPACK_RPM_COMPRESSION_TYPE_TMP "") endif() if(NOT CPACK_RPM_PACKAGE_SOURCES) |