| 663 | } |
| 664 | |
| 665 | bool HandleGlobImpl(std::vector<std::string> const& args, bool recurse, |
| 666 | cmExecutionStatus& status) |
| 667 | { |
| 668 | if (args.size() < 2) { |
| 669 | status.SetError(cmStrCat( |
| 670 | args[0], " must be called with at least one additional argument.")); |
| 671 | return false; |
| 672 | } |
| 673 | |
| 674 | auto i = args.begin(); |
| 675 | |
| 676 | i++; // Get rid of subcommand |
| 677 | |
| 678 | std::string variable = *i; |
| 679 | i++; |
| 680 | cmsys::Glob g; |
| 681 | g.SetRecurse(recurse); |
| 682 | if (recurse) { |
| 683 | g.RecurseThroughSymlinksOff(); |
| 684 | } |
| 685 | |
| 686 | cmake* cm = status.GetMakefile().GetCMakeInstance(); |
| 687 | std::vector<std::string> files; |
| 688 | bool configureDepends = false; |
| 689 | bool warnConfigureLate = false; |
| 690 | while (i != args.end()) { |
| 691 | if (*i == "LIST_DIRECTORIES") { |
| 692 | ++i; // skip LIST_DIRECTORIES |
| 693 | if (i != args.end()) { |
| 694 | if (cmIsOn(*i)) { |
| 695 | g.SetListDirs(true); |
| 696 | g.SetRecurseListDirs(true); |
| 697 | } else if (cmIsOff(*i)) { |
| 698 | g.SetListDirs(false); |
| 699 | g.SetRecurseListDirs(false); |
| 700 | } else { |
| 701 | status.SetError("LIST_DIRECTORIES missing bool value."); |
| 702 | return false; |
| 703 | } |
| 704 | ++i; |
| 705 | } else { |
| 706 | status.SetError("LIST_DIRECTORIES missing bool value."); |
| 707 | return false; |
| 708 | } |
| 709 | } else if (*i == "FOLLOW_SYMLINKS") { |
| 710 | ++i; // skip FOLLOW_SYMLINKS |
| 711 | if (recurse) { |
| 712 | g.RecurseThroughSymlinksOn(); |
| 713 | if (i == args.end()) { |
| 714 | status.SetError( |
| 715 | "GLOB_RECURSE requires a glob expression after FOLLOW_SYMLINKS."); |
| 716 | return false; |
| 717 | } |
| 718 | } |
| 719 | } else if (*i == "RELATIVE") { |
| 720 | ++i; // skip RELATIVE |
| 721 | if (i == args.end()) { |
| 722 | status.SetError("GLOB requires a directory after the RELATIVE tag."); |
no test coverage detected
searching dependent graphs…