diff options
author | Brad King <brad.king@kitware.com> | 2019-07-31 15:42:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-07-31 15:43:17 (GMT) |
commit | 955ebe1c93a35503bf3c81f25c41e481aa94f439 (patch) | |
tree | 7faa6a582a69085ad027e9ef47dd179ed4635810 | |
parent | cb8863279033d9dd81d01edcbb5cc8ae1911b06c (diff) | |
parent | 93af8a2583e2ec8d067a2e8eda544dfc5d3d3b4f (diff) | |
download | CMake-955ebe1c93a35503bf3c81f25c41e481aa94f439.zip CMake-955ebe1c93a35503bf3c81f25c41e481aa94f439.tar.gz CMake-955ebe1c93a35503bf3c81f25c41e481aa94f439.tar.bz2 |
Merge topic 'source_group-tree-files'
93af8a2583 source_group: Fix regression in relative FILES
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3630
-rw-r--r-- | Source/cmSourceGroupCommand.cxx | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/Source/cmSourceGroupCommand.cxx b/Source/cmSourceGroupCommand.cxx index 5cdacaa..04b4d72 100644 --- a/Source/cmSourceGroupCommand.cxx +++ b/Source/cmSourceGroupCommand.cxx @@ -63,15 +63,6 @@ bool rootIsPrefix(const std::string& root, return true; } -std::string prepareFilePathForTree(const std::string& path, - const std::string& currentSourceDir) -{ - if (!cmSystemTools::FileIsFullPath(path)) { - return cmSystemTools::CollapseFullPath(currentSourceDir + "/" + path); - } - return cmSystemTools::CollapseFullPath(path); -} - std::vector<std::string> prepareFilesPathsForTree( const std::vector<std::string>& filesPaths, const std::string& currentSourceDir) @@ -80,9 +71,11 @@ std::vector<std::string> prepareFilesPathsForTree( prepared.reserve(filesPaths.size()); for (auto const& filePath : filesPaths) { + std::string fullPath = + cmSystemTools::CollapseFullPath(filePath, currentSourceDir); // If provided file path is actually not a file, silently ignore it. - if (cmSystemTools::FileExists(filePath, /*isFile=*/true)) { - prepared.push_back(prepareFilePathForTree(filePath, currentSourceDir)); + if (cmSystemTools::FileExists(fullPath, /*isFile=*/true)) { + prepared.emplace_back(std::move(fullPath)); } } |