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

Method Evaluate

Source/cmGeneratorExpressionNode.cxx:5684–5709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5682 ShellPathNode() {} // NOLINT(modernize-use-equals-default)
5683
5684 std::string Evaluate(
5685 std::vector<std::string> const& parameters, cm::GenEx::Evaluation* eval,
5686 GeneratorExpressionContent const* content,
5687 cmGeneratorExpressionDAGChecker* /*dagChecker*/) const override
5688 {
5689 cmList list_in{ parameters.front() };
5690 if (list_in.empty()) {
5691 reportError(eval, content->GetOriginalExpression(),
5692 "\"\" is not an absolute path.");
5693 return std::string();
5694 }
5695 cmStateSnapshot snapshot = eval->Context.LG->GetStateSnapshot();
5696 cmOutputConverter converter(snapshot);
5697 char const* separator = snapshot.GetState()->UseWindowsShell() ? ";" : ":";
5698 std::vector<std::string> list_out;
5699 list_out.reserve(list_in.size());
5700 for (auto const& in : list_in) {
5701 if (!cmSystemTools::FileIsFullPath(in)) {
5702 reportError(eval, content->GetOriginalExpression(),
5703 cmStrCat('"', in, "\" is not an absolute path."));
5704 return std::string();
5705 }
5706 list_out.emplace_back(converter.ConvertDirectorySeparatorsForShell(in));
5707 }
5708 return cmJoin(list_out, separator);
5709 }
5710} shellPathNode;
5711
5712cmGeneratorExpressionNode const* cmGeneratorExpressionNode::GetNode(

Callers

nothing calls this directly

Calls 13

reportErrorFunction · 0.85
GetOriginalExpressionMethod · 0.80
UseWindowsShellMethod · 0.80
reserveMethod · 0.80
emplace_backMethod · 0.80
cmStrCatFunction · 0.70
cmJoinFunction · 0.70
frontMethod · 0.45
emptyMethod · 0.45
GetStateSnapshotMethod · 0.45
GetStateMethod · 0.45

Tested by

no test coverage detected