summaryrefslogtreecommitdiff
path: root/Modules/CPack.cmake
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2021-04-19 19:37:57 +0200
committerBrad King <brad.king@kitware.com>2021-04-22 15:40:13 -0400
commitc5c130e675624eef03f5bcaf848810659e205ed2 (patch)
treeab057134a2452170450b06777f0149f1d6d8ad53 /Modules/CPack.cmake
parent5380d858ff4cb21ae1a8777a9b721af97f598c37 (diff)
downloadcmake-c5c130e675624eef03f5bcaf848810659e205ed2.tar.gz
cmArchiveWrite: Consolidate multiple ways to set thread count
Merge use of SetFilterOption() into more abstract thread count in cmArchiveWrite constructor. libarchive defaulting of threads for threads == 0 seems to be configuration dependent. Preemptively default thread count via std::thread::hardware_concurrency(). Also allow negative values for the thread count in which case the detected hardware concurrency is also used but the given absolute thread count is used as an upper limit.
Diffstat (limited to 'Modules/CPack.cmake')
-rw-r--r--Modules/CPack.cmake18
1 files changed, 13 insertions, 5 deletions
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 3b29ede644..373a707308 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -291,13 +291,21 @@ installers. The most commonly-used variables are:
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.
+ ``CPACK_THREADS`` can be set to specify how many threads will be
+ used for compression.
+
+ A positive integer can be used to specify an exact desired thread count.
+
+ When given a negative integer CPack will use the absolute value
+ as the upper limit but may choose a lower value based on
+ the available hardware concurrency.
+
+ Given 0 CPack will try to use all available CPU cores.
+
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.
+ Currently only ``xz`` compression *may* take advantage of multiple cores.
+ Other compression methods ignore this value and use only one thread.
.. versionadded:: 3.21