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

Function HandleHasItemCommand

Source/cmCMakePathCommand.cxx:700–726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

698}
699
700bool HandleHasItemCommand(
701 std::vector<std::string> const& args, cmExecutionStatus& status,
702 std::function<bool(cmCMakePath const&)> const& has_item)
703{
704 if (args.size() != 3) {
705 status.SetError(
706 cmStrCat(args.front(), " must be called with two arguments."));
707 return false;
708 }
709
710 std::string inputPath;
711 if (!getInputPath(args[1], status, inputPath)) {
712 return false;
713 }
714
715 if (args[2].empty()) {
716 status.SetError("Invalid name for output variable.");
717 return false;
718 }
719
720 cmCMakePath path(inputPath);
721 auto result = has_item(path);
722
723 status.GetMakefile().AddDefinitionBool(args[2], result);
724
725 return true;
726}
727
728bool HandleHasRootNameCommand(std::vector<std::string> const& args,
729 cmExecutionStatus& status)

Callers 8

HandleHasRootNameCommandFunction · 0.85
HandleHasRootPathCommandFunction · 0.85
HandleHasFilenameCommandFunction · 0.85
HandleHasStemCommandFunction · 0.85

Calls 8

getInputPathFunction · 0.85
AddDefinitionBoolMethod · 0.80
cmStrCatFunction · 0.70
sizeMethod · 0.45
SetErrorMethod · 0.45
frontMethod · 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…