Skip to content

CPack: Add new CPACK_ARCHIVE_WRITE_OPTIONS variable

Nils Gladitz requested to merge nilsgladitz/cmake:archive-options into master

The new variable allows passing through custom libarchive write options to the CPack archive generators.

Ultimately I'd like to be able to parallelize compression when using the TXZ generator.

This MR allows me to do that with my system's liblzma/libarchive by using e.g.

set(CPACK_ARCHIVE_WRITE_OPTIONS "threads=8")

For this to work with CMake's bundled libraries as well liblzma would have to be updated to at least 5.2.0 to provide lzma_stream_encoder_mt.

In libarchive this then has to be detected and enabled through the HAVE_LZMA_STREAM_ENCODER_MT macro.

Merge request reports