From 5fe64511d6a9e4c9a329bc48bcfc26789afc0794 Mon Sep 17 00:00:00 2001 From: Konstantin Podsvirov Date: Thu, 17 Aug 2017 21:30:22 +0300 Subject: CPackIFW: Add CPACK_IFW_REPOSITORIES_DIRECTORIES variable Add CPACK_IFW_REPOSITORIES_DIRECTORIES variable to specify additional repositories dirs that will be used to resolve and repack dependent components --- .../dev/cpackifw-repositories-directories.rst | 8 +++++ Modules/CPackIFW.cmake | 6 ++++ Source/CPack/IFW/cmCPackIFWGenerator.cxx | 39 ++++++++++++++++++++++ Source/CPack/IFW/cmCPackIFWGenerator.h | 1 + 4 files changed, 54 insertions(+) create mode 100644 Help/release/dev/cpackifw-repositories-directories.rst diff --git a/Help/release/dev/cpackifw-repositories-directories.rst b/Help/release/dev/cpackifw-repositories-directories.rst new file mode 100644 index 0000000..cda74b8 --- /dev/null +++ b/Help/release/dev/cpackifw-repositories-directories.rst @@ -0,0 +1,8 @@ +cpackifw-repositories-directories +--------------------------------- + +* The :module:`CPackIFW` module gained new + :variable:`CPACK_IFW_REPOSITORIES_DIRECTORIES` variable to specify + additional repositories dirs that will be used to resolve and + repack dependent components. This feature available only + since QtIFW 3.1. diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 0210410..0b42c83 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -260,6 +260,12 @@ # Additional prepared packages dirs that will be used to resolve # dependent components. # +# .. variable:: CPACK_IFW_REPOSITORIES_DIRECTORIES +# +# Additional prepared repository dirs that will be used to resolve and +# repack dependent components. This feature available only +# since QtIFW_ 3.1. +# # Tools # """"" # diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx index 6861623..02940af 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx +++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx @@ -56,6 +56,22 @@ int cmCPackIFWGenerator::PackageFiles() } } + if (!this->RepoDirsVector.empty()) { + if (!this->IsVersionLess("3.1")) { + for (std::vector::iterator it = + this->RepoDirsVector.begin(); + it != this->RepoDirsVector.end(); ++it) { + ifwCmd += " --repository " + *it; + } + } else { + cmCPackIFWLogger(WARNING, "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" " + << "variable is set, but content will be skiped, " + << "because this feature available only since " + << "QtIFW 3.1. Please update your QtIFW instance." + << std::endl); + } + } + if (!this->OnlineOnly && !this->DownloadedPackages.empty()) { ifwCmd += " -i "; std::set::iterator it = @@ -128,6 +144,22 @@ int cmCPackIFWGenerator::PackageFiles() } } + if (!this->RepoDirsVector.empty()) { + if (!this->IsVersionLess("3.1")) { + for (std::vector::iterator it = + this->RepoDirsVector.begin(); + it != this->RepoDirsVector.end(); ++it) { + ifwCmd += " --repository " + *it; + } + } else { + cmCPackIFWLogger(WARNING, "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" " + << "variable is set, but content will be skipped, " + << "because this feature available only since " + << "QtIFW 3.1. Please update your QtIFW instance." + << std::endl); + } + } + if (this->OnlineOnly) { ifwCmd += " --online-only"; } else if (!this->DownloadedPackages.empty() && @@ -266,6 +298,13 @@ int cmCPackIFWGenerator::InitializeInternal() cmSystemTools::ExpandListArgument(dirs, this->PkgsDirsVector); } + // Additional repositories dirs + this->RepoDirsVector.clear(); + if (const char* dirs = + this->GetOption("CPACK_IFW_REPOSITORIES_DIRECTORIES")) { + cmSystemTools::ExpandListArgument(dirs, this->RepoDirsVector); + } + // Installer this->Installer.Generator = this; this->Installer.ConfigureFromOptions(); diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.h b/Source/CPack/IFW/cmCPackIFWGenerator.h index 9d635f8..9fd14bd 100644 --- a/Source/CPack/IFW/cmCPackIFWGenerator.h +++ b/Source/CPack/IFW/cmCPackIFWGenerator.h @@ -148,6 +148,7 @@ private: bool OnlineOnly; bool ResolveDuplicateNames; std::vector PkgsDirsVector; + std::vector RepoDirsVector; }; #endif -- cgit v0.12