diff options
Diffstat (limited to 'Source/cmGetDirectoryPropertyCommand.cxx')
-rw-r--r-- | Source/cmGetDirectoryPropertyCommand.cxx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx index 64438d5..fa4a40b 100644 --- a/Source/cmGetDirectoryPropertyCommand.cxx +++ b/Source/cmGetDirectoryPropertyCommand.cxx @@ -7,7 +7,7 @@ #include "cmMakefile.h" #include "cmMessageType.h" #include "cmPolicies.h" -#include "cmStringAlgorithms.h" +#include "cmProperty.h" #include "cmSystemTools.h" namespace { @@ -37,14 +37,8 @@ bool cmGetDirectoryPropertyCommand(std::vector<std::string> const& args, "DIRECTORY argument provided without subsequent arguments"); return false; } - std::string sd = *i; - // make sure the start dir is a full path - if (!cmSystemTools::FileIsFullPath(sd)) { - sd = cmStrCat(status.GetMakefile().GetCurrentSourceDirectory(), '/', *i); - } - - // The local generators are associated with collapsed paths. - sd = cmSystemTools::CollapseFullPath(sd); + std::string sd = cmSystemTools::CollapseFullPath( + *i, status.GetMakefile().GetCurrentSourceDirectory()); // lookup the makefile from the directory name dir = status.GetMakefile().GetGlobalGenerator()->FindMakefile(sd); @@ -92,7 +86,9 @@ bool cmGetDirectoryPropertyCommand(std::vector<std::string> const& args, break; } } - prop = dir->GetProperty(*i); + if (cmProp p = dir->GetProperty(*i)) { + prop = p->c_str(); + } } StoreResult(status.GetMakefile(), variable, prop); return true; |