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

Function HandleRemoveFilenameCommand

Source/cmCMakePathCommand.cxx:303–331  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

301}
302
303bool HandleRemoveFilenameCommand(std::vector<std::string> const& args,
304 cmExecutionStatus& status)
305{
306 static OutputVariableParser const parser{};
307
308 auto const arguments = parser.Parse(args);
309
310 if (arguments.MaybeReportError(status.GetMakefile())) {
311 return true;
312 }
313
314 if (!parser.GetInputs().empty()) {
315 status.SetError("REMOVE_FILENAME called with unexpected arguments.");
316 return false;
317 }
318
319 std::string inputPath;
320 if (!getInputPath(args[1], status, inputPath)) {
321 return false;
322 }
323
324 cmCMakePath path(inputPath);
325 path.RemoveFileName();
326
327 status.GetMakefile().AddDefinition(
328 arguments.Output ? *arguments.Output : args[1], path.String());
329
330 return true;
331}
332
333bool HandleReplaceFilenameCommand(std::vector<std::string> const& args,
334 cmExecutionStatus& status)

Callers

nothing calls this directly

Calls 8

getInputPathFunction · 0.85
MaybeReportErrorMethod · 0.80
ParseMethod · 0.45
GetMakefileMethod · 0.45
emptyMethod · 0.45
SetErrorMethod · 0.45
AddDefinitionMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…