summaryrefslogtreecommitdiffstats
path: root/Source/cmGetDirectoryPropertyCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGetDirectoryPropertyCommand.cxx')
-rw-r--r--Source/cmGetDirectoryPropertyCommand.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx
index 7fbd479..d892cfa 100644
--- a/Source/cmGetDirectoryPropertyCommand.cxx
+++ b/Source/cmGetDirectoryPropertyCommand.cxx
@@ -7,12 +7,14 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
-#include "cmProperty.h"
#include "cmSystemTools.h"
+#include "cmValue.h"
namespace {
void StoreResult(cmMakefile& makefile, std::string const& variable,
const char* prop);
+void StoreResult(cmMakefile& makefile, std::string const& variable,
+ cmValue prop);
}
// cmGetDirectoryPropertyCommand
@@ -76,7 +78,6 @@ bool cmGetDirectoryPropertyCommand(std::vector<std::string> const& args,
return false;
}
- const char* prop = nullptr;
if (*i == "DEFINITIONS") {
switch (status.GetMakefile().GetPolicyStatus(cmPolicies::CMP0059)) {
case cmPolicies::WARN:
@@ -94,8 +95,7 @@ bool cmGetDirectoryPropertyCommand(std::vector<std::string> const& args,
break;
}
}
- prop = cmToCStr(dir->GetProperty(*i));
- StoreResult(status.GetMakefile(), variable, prop);
+ StoreResult(status.GetMakefile(), variable, dir->GetProperty(*i));
return true;
}
@@ -105,4 +105,9 @@ void StoreResult(cmMakefile& makefile, std::string const& variable,
{
makefile.AddDefinition(variable, prop ? prop : "");
}
+void StoreResult(cmMakefile& makefile, std::string const& variable,
+ cmValue prop)
+{
+ makefile.AddDefinition(variable, prop);
+}
}