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

Function HandleHashCommand

Source/cmCMakePathCommand.cxx:885–913  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

883}
884
885bool HandleHashCommand(std::vector<std::string> const& args,
886 cmExecutionStatus& status)
887{
888 if (args.size() != 3) {
889 status.SetError("HASH must be called with two arguments.");
890 return false;
891 }
892
893 std::string inputPath;
894 if (!getInputPath(args[1], status, inputPath)) {
895 return false;
896 }
897
898 auto const& output = args[2];
899
900 if (output.empty()) {
901 status.SetError("Invalid name for output variable.");
902 return false;
903 }
904
905 auto hash = hash_value(cmCMakePath(inputPath).Normal());
906
907 std::ostringstream out;
908 out << std::setbase(16) << hash;
909
910 status.GetMakefile().AddDefinition(output, out.str());
911
912 return true;
913}
914} // anonymous namespace
915
916bool cmCMakePathCommand(std::vector<std::string> const& args,

Callers

nothing calls this directly

Calls 10

getInputPathFunction · 0.85
cmCMakePathClass · 0.85
NormalMethod · 0.80
strMethod · 0.80
hash_valueFunction · 0.70
sizeMethod · 0.45
SetErrorMethod · 0.45
emptyMethod · 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…