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

Function GetFileSet

Source/cmGeneratorExpressionNode.cxx:3583–3614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3581
3582namespace {
3583bool GetFileSet(std::vector<std::string> const& parameters,
3584 cm::GenEx::Evaluation* eval,
3585 GeneratorExpressionContent const* content, cmFileSet*& fileSet)
3586{
3587 auto const& fileSetName = parameters[0];
3588 auto targetName = parameters[1];
3589 auto* makefile = eval->Context.LG->GetMakefile();
3590 fileSet = nullptr;
3591
3592 auto const TARGET = "TARGET:"_s;
3593
3594 if (cmHasPrefix(targetName, TARGET)) {
3595 targetName = targetName.substr(TARGET.length());
3596 if (targetName.empty()) {
3597 reportError(eval, content->GetOriginalExpression(),
3598 cmStrCat("No value provided for the ", TARGET, " option."));
3599 return false;
3600 }
3601 auto* target = makefile->FindTargetToUse(targetName);
3602 if (!target) {
3603 reportError(eval, content->GetOriginalExpression(),
3604 cmStrCat("Non-existent target: ", targetName));
3605 return false;
3606 }
3607 fileSet = target->GetFileSet(fileSetName);
3608 } else {
3609 reportError(eval, content->GetOriginalExpression(),
3610 cmStrCat("Invalid option. ", TARGET, " expected."));
3611 return false;
3612 }
3613 return true;
3614}
3615}
3616
3617static const struct FileSetExistsNode : public cmGeneratorExpressionNode

Callers 2

EvaluateMethod · 0.85
EvaluateMethod · 0.85

Calls 10

cmHasPrefixFunction · 0.85
reportErrorFunction · 0.85
lengthMethod · 0.80
GetOriginalExpressionMethod · 0.80
FindTargetToUseMethod · 0.80
cmStrCatFunction · 0.70
GetMakefileMethod · 0.45
substrMethod · 0.45
emptyMethod · 0.45
GetFileSetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…