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

Method Evaluate

Source/cmGeneratorExpressionNode.cxx:409–445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407 int NumExpectedParameters() const override { return 2; }
408
409 std::string Evaluate(
410 std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
411 GeneratorExpressionContent const* /*content*/,
412 cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
413 {
414 cmList values;
415 cmList checkValues;
416 bool check = false;
417 switch (eval->Context.LG->GetPolicyStatus(cmPolicies::CMP0085)) {
418 case cmPolicies::WARN:
419 if (parameters.front().empty()) {
420 check = true;
421 checkValues.assign(parameters[1], cmList::EmptyElements::Yes);
422 }
423 CM_FALLTHROUGH;
424 case cmPolicies::OLD:
425 values.assign(parameters[1]);
426 if (check && values != checkValues) {
427 std::ostringstream e;
428 e << cmPolicies::GetPolicyWarning(cmPolicies::CMP0085)
429 << "\nSearch Item:\n \"" << parameters.front()
430 << "\"\nList:\n \"" << parameters[1] << "\"\n";
431 eval->Context.LG->GetCMakeInstance()->IssueMessage(
432 MessageType ::AUTHOR_WARNING, e.str(), eval->Backtrace);
433 return "0";
434 }
435 if (values.empty()) {
436 return "0";
437 }
438 break;
439 case cmPolicies::NEW:
440 values.assign(parameters[1], cmList::EmptyElements::Yes);
441 break;
442 }
443
444 return values.find(parameters.front()) != cmList::npos ? "1" : "0";
445 }
446} inListNode;
447
448static const struct FilterNode : public cmGeneratorExpressionNode

Callers

nothing calls this directly

Calls 8

assignMethod · 0.80
strMethod · 0.80
GetPolicyStatusMethod · 0.45
emptyMethod · 0.45
frontMethod · 0.45
IssueMessageMethod · 0.45
GetCMakeInstanceMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected