summaryrefslogtreecommitdiffstats
path: root/Source/cmSourceGroupCommand.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/cmSourceGroupCommand.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/cmSourceGroupCommand.cxx')
-rw-r--r--Source/cmSourceGroupCommand.cxx21
1 files changed, 4 insertions, 17 deletions
diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx
index cc62952..8350410 100644
--- a/Source/cmSourceGroupCommand.cxx
+++ b/Source/cmSourceGroupCommand.cxx
@@ -30,18 +30,6 @@ std::vector<std::string> tokenizePath(const std::string& path)
return cmTokenize(path, "\\/");
}
-std::string getFullFilePath(const std::string& currentPath,
- const std::string& path)
-{
- std::string fullPath = path;
-
- if (!cmSystemTools::FileIsFullPath(path)) {
- fullPath = cmStrCat(currentPath, '/', path);
- }
-
- return cmSystemTools::CollapseFullPath(fullPath);
-}
-
std::set<std::string> getSourceGroupFilesPaths(
const std::string& root, const std::vector<std::string>& files)
{
@@ -124,7 +112,8 @@ bool addFilesToItsSourceGroups(const std::string& root,
errorMsg = "Could not create source group for file: " + sgFilesPath;
return false;
}
- const std::string fullPath = getFullFilePath(root, sgFilesPath);
+ const std::string fullPath =
+ cmSystemTools::CollapseFullPath(sgFilesPath, root);
sg->AddGroupFile(fullPath);
}
}
@@ -255,10 +244,8 @@ bool cmSourceGroupCommand(std::vector<std::string> const& args,
parsedArguments[kFilesOptionName];
for (auto const& filesArg : filesArguments) {
std::string src = filesArg;
- if (!cmSystemTools::FileIsFullPath(src)) {
- src = cmStrCat(mf.GetCurrentSourceDirectory(), '/', filesArg);
- }
- src = cmSystemTools::CollapseFullPath(src);
+ src =
+ cmSystemTools::CollapseFullPath(src, mf.GetCurrentSourceDirectory());
sg->AddGroupFile(src);
}
}