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

Function HandleSetMode

Source/cmCMakePolicyCommand.cxx:65–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63namespace {
64
65bool HandleSetMode(std::vector<std::string> const& args,
66 cmExecutionStatus& status)
67{
68 if (args.size() != 3) {
69 status.SetError("SET must be given exactly 2 additional arguments.");
70 return false;
71 }
72
73 cmPolicies::PolicyStatus policyStatus;
74 if (args[2] == "OLD") {
75 policyStatus = cmPolicies::OLD;
76 } else if (args[2] == "NEW") {
77 policyStatus = cmPolicies::NEW;
78 } else {
79 status.SetError(
80 cmStrCat("SET given unrecognized policy status \"", args[2], '"'));
81 return false;
82 }
83
84 if (!status.GetMakefile().SetPolicy(args[1].c_str(), policyStatus)) {
85 status.SetError("SET failed to set policy.");
86 return false;
87 }
88 return true;
89}
90
91bool HandleGetMode(std::vector<std::string> const& args,
92 cmExecutionStatus& status)

Callers 1

cmCMakePolicyCommandFunction · 0.85

Calls 6

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…