mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-25 01:28:50 -05:00
Merge topic 'cpackifw-options'
9a24ab6b CPackIFW: Add some options
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1298
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user