summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackGenerator.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-09-14 16:41:44 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2021-09-15 16:30:41 (GMT)
commit7aeb2622789d04e57051f3592908c5f27d31bb17 (patch)
tree408b13f24fee934ba22e6fa937817895d8bf63d7 /Source/CPack/cmCPackGenerator.cxx
parent1375862764faad681b45e6ca99e542862e9ae62c (diff)
downloadCMake-7aeb2622789d04e57051f3592908c5f27d31bb17.zip
CMake-7aeb2622789d04e57051f3592908c5f27d31bb17.tar.gz
CMake-7aeb2622789d04e57051f3592908c5f27d31bb17.tar.bz2
cmCPackGenerator::SetOption accepts cmProp or std::string
Diffstat (limited to 'Source/CPack/cmCPackGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx29
1 files changed, 25 insertions, 4 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 4ad25ad..f55b068 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -994,17 +994,29 @@ bool cmCPackGenerator::ReadListFile(const char* moduleName)
return retval;
}
-void cmCPackGenerator::SetOptionIfNotSet(const std::string& op,
- const char* value)
+template <typename ValueType>
+void cmCPackGenerator::StoreOptionIfNotSet(const std::string& op,
+ ValueType value)
{
cmProp def = this->MakefileMap->GetDefinition(op);
if (cmNonempty(def)) {
return;
}
- this->SetOption(op, value);
+ this->StoreOption(op, value);
}
-void cmCPackGenerator::SetOption(const std::string& op, const char* value)
+void cmCPackGenerator::SetOptionIfNotSet(const std::string& op,
+ const char* value)
+{
+ this->StoreOptionIfNotSet(op, value);
+}
+void cmCPackGenerator::SetOptionIfNotSet(const std::string& op, cmProp value)
+{
+ this->StoreOptionIfNotSet(op, value);
+}
+
+template <typename ValueType>
+void cmCPackGenerator::StoreOption(const std::string& op, ValueType value)
{
if (!value) {
this->MakefileMap->RemoveDefinition(op);
@@ -1016,6 +1028,15 @@ void cmCPackGenerator::SetOption(const std::string& op, const char* value)
this->MakefileMap->AddDefinition(op, value);
}
+void cmCPackGenerator::SetOption(const std::string& op, const char* value)
+{
+ this->StoreOption(op, value);
+}
+void cmCPackGenerator::SetOption(const std::string& op, cmProp value)
+{
+ this->StoreOption(op, value);
+}
+
int cmCPackGenerator::DoPackage()
{
cmCPackLogger(cmCPackLog::LOG_OUTPUT,