summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-01-27 14:02:28 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-01-27 14:02:35 (GMT)
commit7ab6d1e8317f61761ca7e57bc5cf774462a851ba (patch)
tree5403db3ecd0963882a6c27c770a3532d89c563a4 /Modules
parenteff0f75bd2478f56bae68cab25c5892063feb950 (diff)
parentbdf30bdad8dfad258bbc8d387a91f66bee3d0c0f (diff)
downloadCMake-7ab6d1e8317f61761ca7e57bc5cf774462a851ba.zip
CMake-7ab6d1e8317f61761ca7e57bc5cf774462a851ba.tar.gz
CMake-7ab6d1e8317f61761ca7e57bc5cf774462a851ba.tar.bz2
Merge topic 'cpack-compression-threads'
bdf30bdad8 CPack: add CPACK_THREADS variable to control compression threads bcdb5b52a0 libarchive: Fix lzma_stream_encoder_mt detection Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5716
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPack.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index eb1d43b..ef5a7d5 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -282,6 +282,28 @@ installers. The most commonly-used variables are:
received by the cpack program. Defaults to ``FALSE`` for backwards
compatibility.
+.. variable:: CPACK_THREADS
+
+ .. versionadded:: 3.20
+
+ Number of threads to use when performing parallelized operations, such
+ as compressing the installer package.
+
+ Some compression methods used by CPack generators such as Debian or Archive
+ may take advantage of multiple CPU cores to speed up compression.
+ ``CPACK_THREADS`` can be set to positive integer to specify how many threads
+ will be used for compression. If it is set to 0, CPack will set it so that
+ all available CPU cores are used.
+ By default ``CPACK_THREADS`` is set to ``1``.
+
+ Currently only ``xz`` compression *may* take advantage of multiple cores. Other
+ compression methods ignore this value and use only one thread.
+
+ .. note::
+
+ Official CMake binaries available on ``cmake.org`` ship with a ``liblzma``
+ that does not support parallel compression.
+
Variables for Source Package Generators
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -746,6 +768,7 @@ _cpack_set_default(CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/")
_cpack_set_default(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
_cpack_set_default(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
+_cpack_set_default(CPACK_THREADS 1)
# if the user has set CPACK_NSIS_DISPLAY_NAME remember it
if(DEFINED CPACK_NSIS_DISPLAY_NAME)
set(CPACK_NSIS_DISPLAY_NAME_SET TRUE)