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

Function HandleNativePathCommand

Source/cmCMakePathCommand.cxx:555–590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

553}
554
555bool HandleNativePathCommand(std::vector<std::string> const& args,
556 cmExecutionStatus& status)
557{
558 if (args.size() < 3 || args.size() > 4) {
559 status.SetError("NATIVE_PATH must be called with two or three arguments.");
560 return false;
561 }
562
563 static NormalizeParser const parser;
564
565 auto const arguments = parser.Parse(args);
566
567 if (parser.GetInputs().size() != 1) {
568 status.SetError("NATIVE_PATH called with unexpected arguments.");
569 return false;
570 }
571 if (parser.GetInputs().front().empty()) {
572 status.SetError("Invalid name for output variable.");
573 return false;
574 }
575
576 std::string inputPath;
577 if (!getInputPath(args[1], status, inputPath)) {
578 return false;
579 }
580
581 cmCMakePath path(inputPath);
582 if (arguments.Normalize) {
583 path = path.Normal();
584 }
585
586 status.GetMakefile().AddDefinition(parser.GetInputs().front(),
587 path.NativeString());
588
589 return true;
590}
591
592bool HandleConvertCommand(std::vector<std::string> const& args,
593 cmExecutionStatus& status)

Callers

nothing calls this directly

Calls 10

getInputPathFunction · 0.85
NormalMethod · 0.80
NativeStringMethod · 0.80
sizeMethod · 0.45
SetErrorMethod · 0.45
ParseMethod · 0.45
emptyMethod · 0.45
frontMethod · 0.45
AddDefinitionMethod · 0.45
GetMakefileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…