diff options
author | Erlend E. Aasland <erlend.aasland@innova.no> | 2021-10-26 22:57:56 +0200 |
---|---|---|
committer | Erlend E. Aasland <erlend.aasland@innova.no> | 2021-10-28 15:46:22 +0200 |
commit | 62ef2729eeb9dbe636b4e1ae57cfdb6998d251f3 (patch) | |
tree | d10fab0fba367121834ca1fc59c0437884871852 /Source/CPack | |
parent | a3791b24c9a84788ae426697c768f5126fab8c75 (diff) | |
download | cmake-62ef2729eeb9dbe636b4e1ae57cfdb6998d251f3.tar.gz |
CPackIFW: add support for archive format and compression level options
Adds the following CPackIFW variables:
- CPACK_IFW_ARCHIVE_FORMAT
- CPACK_IFW_ARCHIVE_COMPRESSION
These variables control mirror the --archive-format and --compression
options of the QtIFW binarycreator and repogen tools.
Fixes: #22803
Co-authored-by: Erlend E. Aasland <erlend.aasland@innova.no>
Co-authored-by: Awen Autret
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.cxx | 30 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWGenerator.h | 2 |
2 files changed, 32 insertions, 0 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 9b33eec232..f35d7e9b6f 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 902ebaf20b..b853e18e4c 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; |