diff options
author | Mateusz Janek <stryku2393@gmail.com> | 2018-01-25 06:28:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-01-30 17:49:26 (GMT) |
commit | 365e02e73ea9e6177ff5fb6de73e4187eded8afc (patch) | |
tree | bfb085db9b540882fdc0aa8fa90a62f60b18e617 /Source/cmSourceGroupCommand.h | |
parent | e07cf68f46a8383466e7ef4cab1e33e035525c71 (diff) | |
download | CMake-365e02e73ea9e6177ff5fb6de73e4187eded8afc.zip CMake-365e02e73ea9e6177ff5fb6de73e4187eded8afc.tar.gz CMake-365e02e73ea9e6177ff5fb6de73e4187eded8afc.tar.bz2 |
source_group: Fix TREE argument parsing
Fixes: #17581
Diffstat (limited to 'Source/cmSourceGroupCommand.h')
-rw-r--r-- | Source/cmSourceGroupCommand.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/Source/cmSourceGroupCommand.h b/Source/cmSourceGroupCommand.h index ed02ca5..ec5ad32 100644 --- a/Source/cmSourceGroupCommand.h +++ b/Source/cmSourceGroupCommand.h @@ -5,6 +5,7 @@ #include "cmConfigure.h" // IWYU pragma: keep +#include <map> #include <string> #include <vector> @@ -34,10 +35,24 @@ public: cmExecutionStatus& status) override; private: - bool processTree(const std::vector<std::string>& args, - std::string& errorMsg); - bool checkTreeArgumentsPreconditions(const std::vector<std::string>& args, - std::string& errorMsg) const; + typedef std::map<std::string, std::vector<std::string>> ParsedArguments; + typedef std::vector<std::string> ExpectedOptions; + + ExpectedOptions getExpectedOptions() const; + + bool isExpectedOption(const std::string& argument, + const ExpectedOptions& expectedOptions); + + void parseArguments(const std::vector<std::string>& args, + cmSourceGroupCommand::ParsedArguments& parsedArguments); + + bool processTree(ParsedArguments& parsedArguments, std::string& errorMsg); + + bool checkArgumentsPreconditions(const ParsedArguments& parsedArguments, + std::string& errorMsg) const; + bool checkSingleParameterArgumentPreconditions( + const std::string& argument, const ParsedArguments& parsedArguments, + std::string& errorMsg) const; }; #endif |