summaryrefslogtreecommitdiffstats
path: root/Source/cmGetPropertyCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGetPropertyCommand.cxx')
-rw-r--r--Source/cmGetPropertyCommand.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index c976dda..5f20075 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -34,10 +34,6 @@ enum OutType
OutSet
};
-// Implementation of result storage.
-bool StoreResult(OutType infoType, cmMakefile& makefile,
- const std::string& variable, const char* value);
-
// Implementation of each property type.
bool HandleGlobalMode(cmExecutionStatus& status, const std::string& name,
OutType infoType, const std::string& variable,
@@ -255,8 +251,10 @@ bool cmGetPropertyCommand(std::vector<std::string> const& args,
namespace {
+// Implementation of result storage.
+template <typename ValueType>
bool StoreResult(OutType infoType, cmMakefile& makefile,
- const std::string& variable, const char* value)
+ const std::string& variable, ValueType value)
{
if (infoType == OutSet) {
makefile.AddDefinition(variable, value ? "1" : "0");
@@ -270,10 +268,11 @@ bool StoreResult(OutType infoType, cmMakefile& makefile,
}
return true;
}
+template <>
bool StoreResult(OutType infoType, cmMakefile& makefile,
- const std::string& variable, cmProp value)
+ const std::string& variable, std::nullptr_t value)
{
- return StoreResult(infoType, makefile, variable, value.GetCStr());
+ return StoreResult(infoType, makefile, variable, cmProp(value));
}
bool HandleGlobalMode(cmExecutionStatus& status, const std::string& name,