| 553 | } |
| 554 | |
| 555 | bool 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 | |
| 592 | bool HandleConvertCommand(std::vector<std::string> const& args, |
| 593 | cmExecutionStatus& status) |
nothing calls this directly
no test coverage detected
searching dependent graphs…