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

Function HandleVersionMode

Source/cmCMakePolicyCommand.cxx:137–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137bool HandleVersionMode(std::vector<std::string> const& args,
138 cmExecutionStatus& status)
139{
140 if (args.size() <= 1) {
141 status.SetError("VERSION not given an argument");
142 return false;
143 }
144 if (args.size() >= 3) {
145 status.SetError("VERSION given too many arguments");
146 return false;
147 }
148 std::string const& version_string = args[1];
149
150 // Separate the <min> version and any trailing ...<max> component.
151 std::string::size_type const dd = version_string.find("...");
152 std::string const version_min = version_string.substr(0, dd);
153 std::string const version_max = dd != std::string::npos
154 ? version_string.substr(dd + 3, std::string::npos)
155 : std::string();
156 if (dd != std::string::npos &&
157 (version_min.empty() || version_max.empty())) {
158 status.SetError(
159 cmStrCat("VERSION \"", version_string,
160 R"(" does not have a version on both sides of "...".)"));
161 return false;
162 }
163
164 return status.GetMakefile().SetPolicyVersion(version_min, version_max);
165}
166
167bool HandleGetWarningMode(std::vector<std::string> const& args,
168 cmExecutionStatus& status)

Callers 1

cmCMakePolicyCommandFunction · 0.85

Calls 8

SetPolicyVersionMethod · 0.80
cmStrCatFunction · 0.70
sizeMethod · 0.45
SetErrorMethod · 0.45
findMethod · 0.45
substrMethod · 0.45
emptyMethod · 0.45
GetMakefileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…