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

Function HandleSetCommand

Source/cmCMakePathCommand.cxx:215–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215bool HandleSetCommand(std::vector<std::string> const& args,
216 cmExecutionStatus& status)
217{
218 if (args.size() < 3 || args.size() > 4) {
219 status.SetError("SET must be called with two or three arguments.");
220 return false;
221 }
222
223 if (args[1].empty()) {
224 status.SetError("Invalid name for path variable.");
225 return false;
226 }
227
228 static NormalizeParser const parser;
229
230 auto const arguments = parser.Parse(args);
231
232 if (parser.GetInputs().size() != 1) {
233 status.SetError("SET called with unexpected arguments.");
234 return false;
235 }
236
237 auto path =
238 cmCMakePath(parser.GetInputs().front(), cmCMakePath::native_format);
239
240 if (arguments.Normalize) {
241 path = path.Normal();
242 }
243
244 status.GetMakefile().AddDefinition(args[1], path.GenericString());
245
246 return true;
247}
248
249bool HandleAppendCommand(std::vector<std::string> const& args,
250 cmExecutionStatus& status)

Callers

nothing calls this directly

Calls 10

cmCMakePathClass · 0.85
NormalMethod · 0.80
GenericStringMethod · 0.80
sizeMethod · 0.45
SetErrorMethod · 0.45
emptyMethod · 0.45
ParseMethod · 0.45
frontMethod · 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…