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

Function cmCMakePolicyCommand

Source/cmCMakePolicyCommand.cxx:22–61  ·  view source on GitHub ↗

cmCMakePolicyCommand

Source from the content-addressed store, hash-verified

20
21// cmCMakePolicyCommand
22bool cmCMakePolicyCommand(std::vector<std::string> const& args,
23 cmExecutionStatus& status)
24{
25 if (args.empty()) {
26 status.SetError("requires at least one argument.");
27 return false;
28 }
29
30 if (args[0] == "SET") {
31 return HandleSetMode(args, status);
32 }
33 if (args[0] == "GET") {
34 return HandleGetMode(args, status);
35 }
36 if (args[0] == "PUSH") {
37 if (args.size() > 1) {
38 status.SetError("PUSH may not be given additional arguments.");
39 return false;
40 }
41 status.GetMakefile().PushPolicy();
42 return true;
43 }
44 if (args[0] == "POP") {
45 if (args.size() > 1) {
46 status.SetError("POP may not be given additional arguments.");
47 return false;
48 }
49 status.GetMakefile().PopPolicy();
50 return true;
51 }
52 if (args[0] == "VERSION") {
53 return HandleVersionMode(args, status);
54 }
55 if (args[0] == "GET_WARNING") {
56 return HandleGetWarningMode(args, status);
57 }
58
59 status.SetError(cmStrCat("given unknown first argument \"", args[0], '"'));
60 return false;
61}
62
63namespace {
64

Callers

nothing calls this directly

Calls 11

HandleSetModeFunction · 0.85
HandleGetModeFunction · 0.85
HandleVersionModeFunction · 0.85
HandleGetWarningModeFunction · 0.85
cmStrCatFunction · 0.70
emptyMethod · 0.45
SetErrorMethod · 0.45
sizeMethod · 0.45
PushPolicyMethod · 0.45
GetMakefileMethod · 0.45
PopPolicyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…