| 698 | } |
| 699 | |
| 700 | bool HandleHasItemCommand( |
| 701 | std::vector<std::string> const& args, cmExecutionStatus& status, |
| 702 | std::function<bool(cmCMakePath const&)> const& has_item) |
| 703 | { |
| 704 | if (args.size() != 3) { |
| 705 | status.SetError( |
| 706 | cmStrCat(args.front(), " must be called with two arguments.")); |
| 707 | return false; |
| 708 | } |
| 709 | |
| 710 | std::string inputPath; |
| 711 | if (!getInputPath(args[1], status, inputPath)) { |
| 712 | return false; |
| 713 | } |
| 714 | |
| 715 | if (args[2].empty()) { |
| 716 | status.SetError("Invalid name for output variable."); |
| 717 | return false; |
| 718 | } |
| 719 | |
| 720 | cmCMakePath path(inputPath); |
| 721 | auto result = has_item(path); |
| 722 | |
| 723 | status.GetMakefile().AddDefinitionBool(args[2], result); |
| 724 | |
| 725 | return true; |
| 726 | } |
| 727 | |
| 728 | bool HandleHasRootNameCommand(std::vector<std::string> const& args, |
| 729 | cmExecutionStatus& status) |
no test coverage detected
searching dependent graphs…