diff options
author | Konstantin Podsvirov <konstantin@podsvirov.pro> | 2017-09-21 18:34:33 (GMT) |
---|---|---|
committer | Konstantin Podsvirov <konstantin@podsvirov.pro> | 2017-09-21 18:34:33 (GMT) |
commit | 9a24ab6b6386efbfa2ea9a07a3fe10f6f013fe8c (patch) | |
tree | 04cfb8af932f01f4e1dd3a7f14049bcdcef39794 /Source/CPack/IFW | |
parent | 46f7a6707bd11f277a11ad7cc59adcbb1077407c (diff) | |
download | CMake-9a24ab6b6386efbfa2ea9a07a3fe10f6f013fe8c.zip CMake-9a24ab6b6386efbfa2ea9a07a3fe10f6f013fe8c.tar.gz CMake-9a24ab6b6386efbfa2ea9a07a3fe10f6f013fe8c.tar.bz2 |
CPackIFW: Add some options
The `CPackIFW` module `cpack_ifw_configure_component` and
`cpack_ifw_configure_component_group` commands gained a new
`REPLACES` and `CHECKABLE` options.
Diffstat (limited to 'Source/CPack/IFW')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWPackage.cxx | 37 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWPackage.h | 6 |
2 files changed, 43 insertions, 0 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx index 7b23005..d3ce15c 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.cxx +++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx @@ -482,6 +482,15 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) this->ForcedInstallation = "false"; } + // Replaces + option = prefix + "REPLACES"; + if (this->IsSetToEmpty(option)) { + this->Replaces.clear(); + } else if (const char* value = this->GetOption(option)) { + this->Replaces.clear(); + cmSystemTools::ExpandListArgument(value, this->Replaces); + } + // Requires admin rights option = prefix + "REQUIRES_ADMIN_RIGHTS"; if (this->IsSetToEmpty(option)) { @@ -492,6 +501,16 @@ int cmCPackIFWPackage::ConfigureFromPrefix(const std::string& prefix) this->RequiresAdminRights = "false"; } + // Checkable + option = prefix + "CHECKABLE"; + if (this->IsSetToEmpty(option)) { + this->Checkable.clear(); + } else if (this->IsOn(option)) { + this->Checkable = "true"; + } else if (this->IsSetToOff(option)) { + this->Checkable = "false"; + } + return 1; } @@ -652,6 +671,19 @@ void cmCPackIFWPackage::GeneratePackageFile() xout.Element("ForcedInstallation", this->ForcedInstallation); } + // Replaces + if (!this->Replaces.empty()) { + std::ostringstream replaces; + std::vector<std::string>::iterator it = this->Replaces.begin(); + replaces << *it; + ++it; + while (it != this->Replaces.end()) { + replaces << "," << *it; + ++it; + } + xout.Element("Replaces", replaces.str()); + } + if (!this->RequiresAdminRights.empty()) { xout.Element("RequiresAdminRights", this->RequiresAdminRights); } @@ -672,6 +704,11 @@ void cmCPackIFWPackage::GeneratePackageFile() xout.Element("SortingPriority", this->SortingPriority); } + // Checkable + if (!this->Checkable.empty()) { + xout.Element("Checkable", this->Checkable); + } + xout.EndElement(); xout.EndDocument(); } diff --git a/Source/CPack/IFW/cmCPackIFWPackage.h b/Source/CPack/IFW/cmCPackIFWPackage.h index cec59b0..ae41146 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.h +++ b/Source/CPack/IFW/cmCPackIFWPackage.h @@ -114,9 +114,15 @@ public: /// Determines that the package must always be installed std::string ForcedInstallation; + /// List of components to replace + std::vector<std::string> Replaces; + /// Package needs to be installed with elevated permissions std::string RequiresAdminRights; + /// Set to false if you want to hide the checkbox for an item + std::string Checkable; + public: // Internal implementation |