MCPcopy Create free account
hub / github.com/Kitware/CMake / prepareFilesPathsForTree

Function prepareFilesPathsForTree

Source/cmSourceGroupCommand.cxx:58–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58std::vector<std::string> prepareFilesPathsForTree(
59 std::vector<std::string> const& filesPaths,
60 std::string const& currentSourceDir)
61{
62 std::vector<std::string> prepared;
63 prepared.reserve(filesPaths.size());
64
65 for (auto const& filePath : filesPaths) {
66 std::string fullPath =
67 cmSystemTools::CollapseFullPath(filePath, currentSourceDir);
68 // If provided file path is actually not a directory, silently ignore it.
69 if (cmSystemTools::FileIsDirectory(fullPath)) {
70 continue;
71 }
72
73 // Handle directory that doesn't exist yet.
74 if (!fullPath.empty() &&
75 (fullPath.back() == '/' || fullPath.back() == '\\')) {
76 continue;
77 }
78
79 prepared.emplace_back(std::move(fullPath));
80 }
81
82 return prepared;
83}
84
85bool addFilesToItsSourceGroups(std::string const& root,
86 std::set<std::string> const& sgFilesPaths,

Callers 1

processTreeFunction · 0.85

Calls 6

moveFunction · 0.85
reserveMethod · 0.80
emplace_backMethod · 0.80
sizeMethod · 0.45
emptyMethod · 0.45
backMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…