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

Function processTree

Source/cmSourceGroupCommand.cxx:266–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264}
265
266static bool processTree(cmMakefile& mf, ParsedArguments& parsedArguments,
267 std::string& errorMsg)
268{
269 std::string const root =
270 cmSystemTools::CollapseFullPath(parsedArguments[kTreeOptionName].front());
271 std::string prefix = parsedArguments[kPrefixOptionName].empty()
272 ? ""
273 : parsedArguments[kPrefixOptionName].front();
274
275 std::vector<std::string> files;
276 auto filesArgIt = parsedArguments.find(kFilesOptionName);
277 if (filesArgIt != parsedArguments.end()) {
278 files = filesArgIt->second;
279 } else {
280 std::vector<std::unique_ptr<cmSourceFile>> const& srcFiles =
281 mf.GetSourceFiles();
282 for (auto const& srcFile : srcFiles) {
283 if (!srcFile->GetIsGenerated()) {
284 files.push_back(srcFile->GetLocation().GetFullPath());
285 }
286 }
287 }
288
289 std::vector<std::string> const filesVector =
290 prepareFilesPathsForTree(files, mf.GetCurrentSourceDirectory());
291
292 if (!rootIsPrefix(root, filesVector, errorMsg)) {
293 return false;
294 }
295
296 std::set<std::string> sourceGroupPaths =
297 getSourceGroupFilesPaths(root, filesVector);
298
299 return addFilesToItsSourceGroups(root, sourceGroupPaths, prefix, mf,
300 errorMsg);
301}
302
303static bool checkSingleParameterArgumentPreconditions(
304 std::string const& argument, ParsedArguments const& parsedArguments,

Callers 1

cmSourceGroupCommandFunction · 0.85

Calls 13

prepareFilesPathsForTreeFunction · 0.85
rootIsPrefixFunction · 0.85
getSourceGroupFilesPathsFunction · 0.85
GetSourceFilesMethod · 0.80
GetIsGeneratedMethod · 0.80
push_backMethod · 0.80
frontMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
GetFullPathMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…