diff --git a/CMakeLists.txt b/CMakeLists.txt
index 045a283fa5..4f03c39cbf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -579,6 +579,7 @@ macro (CMAKE_BUILD_UTILITIES)
set(LIBLZMA_INCLUDE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmliblzma/liblzma/api")
set(LIBLZMA_LIBRARY cmliblzma)
+ set(HAVE_LZMA_STREAM_ENCODER_MT 1)
endif()
endif()
diff --git a/Help/cpack_gen/archive.rst b/Help/cpack_gen/archive.rst
index b9418126f8..47e8e13546 100644
--- a/Help/cpack_gen/archive.rst
+++ b/Help/cpack_gen/archive.rst
@@ -82,7 +82,8 @@ CPack generators which are essentially archives at their core. These include:
See also the :variable:`CPACK_THREADS` variable.
-.. note::
+ .. versionadded:: 3.21
- Official CMake binaries available on ``cmake.org`` ship with a ``liblzma``
- that does not support parallel compression.
+ Official CMake binaries available on ``cmake.org`` now ship
+ with a ``liblzma`` that supports parallel compression.
+ Older versions did not.
diff --git a/Help/release/dev/lzma-threads.rst b/Help/release/dev/lzma-threads.rst
new file mode 100644
index 0000000000..a481cfa684
--- /dev/null
+++ b/Help/release/dev/lzma-threads.rst
@@ -0,0 +1,7 @@
+lzma-threads
+------------
+
+* The precompiled binaries provided on
+ `cmake.org `_ now support
+ ``liblzma`` multi-threading. See the :variable:`CPACK_THREADS` and
+ :variable:`CPACK_ARCHIVE_THREADS` variables.
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index ef5a7d5b1a..373a707308 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -291,18 +291,27 @@ 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.
- .. note::
+ .. versionadded:: 3.21
- Official CMake binaries available on ``cmake.org`` ship with a ``liblzma``
- that does not support parallel compression.
+ Official CMake binaries available on ``cmake.org`` now ship
+ with a ``liblzma`` that supports parallel compression.
+ Older versions did not.
Variables for Source Package Generators
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 7fd12dd4c1..d9234e6669 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -2,14 +2,13 @@
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmCPackArchiveGenerator.h"
+#include
#include
#include