| 165 | } |
| 166 | |
| 167 | bool HandleGetWarningMode(std::vector<std::string> const& args, |
| 168 | cmExecutionStatus& status) |
| 169 | { |
| 170 | if (args.size() != 3) { |
| 171 | status.SetError( |
| 172 | "GET_WARNING must be given exactly 2 additional arguments."); |
| 173 | return false; |
| 174 | } |
| 175 | |
| 176 | // Get arguments. |
| 177 | std::string const& id = args[1]; |
| 178 | std::string const& var = args[2]; |
| 179 | |
| 180 | // Lookup the policy number. |
| 181 | cmPolicies::PolicyID pid; |
| 182 | if (!cmPolicies::GetPolicyID(id.c_str(), pid)) { |
| 183 | status.SetError( |
| 184 | cmStrCat("GET_WARNING given policy \"", id, |
| 185 | "\" which is not known to this version of CMake.")); |
| 186 | return false; |
| 187 | } |
| 188 | |
| 189 | // Lookup the policy warning. |
| 190 | status.GetMakefile().AddDefinition(var, cmPolicies::GetPolicyWarning(pid)); |
| 191 | |
| 192 | return true; |
| 193 | } |
| 194 | } |
no test coverage detected
searching dependent graphs…