summaryrefslogtreecommitdiffstats
path: root/Source/cmGetDirectoryPropertyCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-18 18:22:11 (GMT)
committerBrad King <brad.king@kitware.com>2020-03-24 14:10:06 (GMT)
commit25f48761faad8308f23690a51030a49d05007391 (patch)
tree1f3ece02d09b79e7a6bab7b0fb4593323e5e66bd /Source/cmGetDirectoryPropertyCommand.cxx
parent12b39aef7599a3ab6b1c1b9537d427839a9346b3 (diff)
downloadCMake-25f48761faad8308f23690a51030a49d05007391.zip
CMake-25f48761faad8308f23690a51030a49d05007391.tar.gz
CMake-25f48761faad8308f23690a51030a49d05007391.tar.bz2
Simplify absolute path conversions using CollapseFullPath full signature
Diffstat (limited to 'Source/cmGetDirectoryPropertyCommand.cxx')
-rw-r--r--Source/cmGetDirectoryPropertyCommand.cxx11
1 files changed, 2 insertions, 9 deletions
diff --git a/Source/cmGetDirectoryPropertyCommand.cxx b/Source/cmGetDirectoryPropertyCommand.cxx
index 64438d5..65b3457 100644
--- a/Source/cmGetDirectoryPropertyCommand.cxx
+++ b/Source/cmGetDirectoryPropertyCommand.cxx
@@ -7,7 +7,6 @@
#include "cmMakefile.h"
#include "cmMessageType.h"
#include "cmPolicies.h"
-#include "cmStringAlgorithms.h"
#include "cmSystemTools.h"
namespace {
@@ -37,14 +36,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);