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
This commit is contained in:
Brad King
2021-10-29 12:54:10 +00:00
committed by Kitware Robot
4 changed files with 81 additions and 0 deletions
+40
View File
@@ -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
""""""""""
@@ -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.
+30
View File
@@ -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();
+2
View File
@@ -151,6 +151,8 @@ private:
std::string FrameworkVersion;
std::string ExecutableSuffix;
std::string OutputExtension;
std::string ArchiveFormat;
std::string ArchiveCompression;
bool OnlineOnly;
bool ResolveDuplicateNames;