MCPcopy Create free account
hub / github.com/Kitware/CMake / HandleGetWarningMode

Function HandleGetWarningMode

Source/cmCMakePolicyCommand.cxx:167–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167bool 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}

Callers 1

cmCMakePolicyCommandFunction · 0.85

Calls 6

c_strMethod · 0.80
cmStrCatFunction · 0.70
sizeMethod · 0.45
SetErrorMethod · 0.45
AddDefinitionMethod · 0.45
GetMakefileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…