diff options
author | Brad King <brad.king@kitware.com> | 2021-10-29 12:54:10 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-10-29 12:54:23 (GMT) |
commit | 7a31aeffe86b08e5434ebabfcf199cba6d9e4223 (patch) | |
tree | 47bfd82fdb00d744c38e81303f162002a3cc7612 | |
parent | 0486f9e56eff776f1960880b1a825c208090466d (diff) | |
parent | 62ef2729eeb9dbe636b4e1ae57cfdb6998d251f3 (diff) | |
download | CMake-7a31aeffe86b08e5434ebabfcf199cba6d9e4223.zip CMake-7a31aeffe86b08e5434ebabfcf199cba6d9e4223.tar.gz CMake-7a31aeffe86b08e5434ebabfcf199cba6d9e4223.tar.bz2 |
Merge topic 'ifw-archive-format'
62ef2729ee CPackIFW: add support for archive format and compression level options
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !6666
-rw-r--r-- | Help/cpack_gen/ifw.rst | 40 | ||||
-rw-r--r-- | Help/release/dev/cpackifw-archive-format.rst | 9 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.cxx | 30 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.h | 2 |
4 files changed, 81 insertions, 0 deletions
diff --git a/Help/cpack_gen/ifw.rst b/Help/cpack_gen/ifw.rst index 6b8bc26..8bfcd98 100644 --- a/Help/cpack_gen/ifw.rst +++ b/Help/cpack_gen/ifw.rst @@ -292,6 +292,46 @@ Package This feature is available for QtIFW 4.0.0 and newer. +.. variable:: CPACK_IFW_ARCHIVE_FORMAT + + .. versionadded:: 3.23 + + Set the format used when packaging new component data archives. If you omit + this option, the ``7z`` format will be used as a default. Supported formats: + + * 7z + * zip + * tar.gz + * tar.bz2 + * tar.xz + + .. note:: + + If the Qt Installer Framework tools were built without libarchive support, + only ``7z`` format is supported. + + This feature is available for QtIFW 4.2.0 and newer. + +.. variable:: CPACK_IFW_ARCHIVE_COMPRESSION + + .. versionadded:: 3.23 + + Archive compression level. Defaults to 5 (*Normal compression*). + + * 0 (*No compression*) + * 1 (*Fastest compressing*) + * 3 (*Fast compressing*) + * 5 (*Normal compressing*) + * 7 (*Maximum compressing*) + * 9 (*Ultra compressing*) + + .. note:: + + Some formats do not support all the possible values. For example ``zip`` + compression only supports values from 1 to 7. + + This feature is available for QtIFW 4.2.0 and newer. + Components """""""""" diff --git a/Help/release/dev/cpackifw-archive-format.rst b/Help/release/dev/cpackifw-archive-format.rst new file mode 100644 index 0000000..8884d74 --- /dev/null +++ b/Help/release/dev/cpackifw-archive-format.rst @@ -0,0 +1,9 @@ + +cpackifw-archive-format +----------------------- + +* The :cpack_gen:`CPack IFW Generator` gained the new + :variable:`CPACK_IFW_ARCHIVE_FORMAT` and + :variable:`CPACK_IFW_ARCHIVE_COMPRESSION` variables for setting the format + used when packaging new component data archives, and choosing the compression + level used. These features are available for QtIFW 4.2 and newer. diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 9b33eec..f35d7e9 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -58,6 +58,17 @@ std::vector<std::string> cmCPackIFWGenerator::BuildRepogenCommand() ifwCmd.emplace_back(this->RepoGen); + if (!this->IsVersionLess("4.2")) { + if (!this->ArchiveFormat.empty()) { + ifwCmd.emplace_back("--archive-format"); + ifwCmd.emplace_back(this->ArchiveFormat); + } + if (!this->ArchiveCompression.empty()) { + ifwCmd.emplace_back("--compression"); + ifwCmd.emplace_back(this->ArchiveCompression); + } + } + if (this->IsVersionLess("2.0.0")) { ifwCmd.emplace_back("-c"); ifwCmd.emplace_back(this->toplevel + "/config/config.xml"); @@ -157,6 +168,17 @@ std::vector<std::string> cmCPackIFWGenerator::BuildBinaryCreatorCommmand() ifwCmd.emplace_back(this->BinCreator); + if (!this->IsVersionLess("4.2")) { + if (!this->ArchiveFormat.empty()) { + ifwCmd.emplace_back("--archive-format"); + ifwCmd.emplace_back(this->ArchiveFormat); + } + if (!this->ArchiveCompression.empty()) { + ifwCmd.emplace_back("--compression"); + ifwCmd.emplace_back(this->ArchiveCompression); + } + } + ifwCmd.emplace_back("-c"); ifwCmd.emplace_back(this->toplevel + "/config/config.xml"); @@ -354,6 +376,14 @@ int cmCPackIFWGenerator::InitializeInternal() cmExpandList(dirs, this->RepoDirsVector); } + // Archive format and compression level + if (cmValue af = this->GetOption("CPACK_IFW_ARCHIVE_FORMAT")) { + this->ArchiveFormat = *af; + } + if (cmValue ac = this->GetOption("CPACK_IFW_ARCHIVE_COMPRESSION")) { + this->ArchiveCompression = *ac; + } + // Installer this->Installer.Generator = this; this->Installer.ConfigureFromOptions(); diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.h b/Source/CPack/IFW/cmCPackIFWGenerator.h index 902ebaf..b853e18 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.h +++ b/Source/CPack/IFW/cmCPackIFWGenerator.h @@ -151,6 +151,8 @@ private: std::string FrameworkVersion; std::string ExecutableSuffix; std::string OutputExtension; + std::string ArchiveFormat; + std::string ArchiveCompression; bool OnlineOnly; bool ResolveDuplicateNames; |