| 1629 | } |
| 1630 | |
| 1631 | bool HandleDirectoryMode(std::vector<std::string> const& args, |
| 1632 | cmExecutionStatus& status) |
| 1633 | { |
| 1634 | Helper helper(status); |
| 1635 | |
| 1636 | enum Doing |
| 1637 | { |
| 1638 | DoingNone, |
| 1639 | DoingDirs, |
| 1640 | DoingDestination, |
| 1641 | DoingPattern, |
| 1642 | DoingRegex, |
| 1643 | DoingPermsFile, |
| 1644 | DoingPermsDir, |
| 1645 | DoingPermsMatch, |
| 1646 | DoingConfigurations, |
| 1647 | DoingComponent, |
| 1648 | DoingType |
| 1649 | }; |
| 1650 | Doing doing = DoingDirs; |
| 1651 | bool in_match_mode = false; |
| 1652 | bool optional = false; |
| 1653 | bool exclude_from_all = false; |
| 1654 | bool message_never = false; |
| 1655 | std::vector<std::string> dirs; |
| 1656 | cm::optional<std::string> destination; |
| 1657 | std::string permissions_file; |
| 1658 | std::string permissions_dir; |
| 1659 | std::vector<std::string> configurations; |
| 1660 | std::string component = helper.DefaultComponentName; |
| 1661 | std::string literal_args; |
| 1662 | std::string type; |
| 1663 | for (unsigned int i = 1; i < args.size(); ++i) { |
| 1664 | if (args[i] == "DESTINATION") { |
| 1665 | if (in_match_mode) { |
| 1666 | status.SetError(cmStrCat(args[0], " does not allow \"", args[i], |
| 1667 | "\" after PATTERN or REGEX.")); |
| 1668 | return false; |
| 1669 | } |
| 1670 | |
| 1671 | // Switch to setting the destination property. |
| 1672 | doing = DoingDestination; |
| 1673 | } else if (args[i] == "TYPE") { |
| 1674 | if (in_match_mode) { |
| 1675 | status.SetError(cmStrCat(args[0], " does not allow \"", args[i], |
| 1676 | "\" after PATTERN or REGEX.")); |
| 1677 | return false; |
| 1678 | } |
| 1679 | |
| 1680 | // Switch to setting the type. |
| 1681 | doing = DoingType; |
| 1682 | } else if (args[i] == "OPTIONAL") { |
| 1683 | if (in_match_mode) { |
| 1684 | status.SetError(cmStrCat(args[0], " does not allow \"", args[i], |
| 1685 | "\" after PATTERN or REGEX.")); |
| 1686 | return false; |
| 1687 | } |
| 1688 |
nothing calls this directly
no test coverage detected
searching dependent graphs…