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

Method SetVersionVariables

Source/cmFindPackageCommand.cxx:1414–1434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1412}
1413
1414void cmFindPackageCommand::SetVersionVariables(
1415 std::function<void(std::string const&, cm::string_view)> const&
1416 addDefinition,
1417 std::string const& prefix, std::string const& version,
1418 unsigned int const count, unsigned int const major, unsigned int const minor,
1419 unsigned int const patch, unsigned int const tweak)
1420{
1421 addDefinition(prefix, version);
1422
1423 char buf[64];
1424 snprintf(buf, sizeof(buf), "%u", major);
1425 addDefinition(prefix + "_MAJOR", buf);
1426 snprintf(buf, sizeof(buf), "%u", minor);
1427 addDefinition(prefix + "_MINOR", buf);
1428 snprintf(buf, sizeof(buf), "%u", patch);
1429 addDefinition(prefix + "_PATCH", buf);
1430 snprintf(buf, sizeof(buf), "%u", tweak);
1431 addDefinition(prefix + "_TWEAK", buf);
1432 snprintf(buf, sizeof(buf), "%u", count);
1433 addDefinition(prefix + "_COUNT", buf);
1434}
1435
1436void cmFindPackageCommand::SetModuleVariables()
1437{

Callers 3

SetModuleVariablesMethod · 0.95
CheckVersionFileMethod · 0.95
StoreVersionFoundMethod · 0.95

Calls 1

snprintfFunction · 0.50

Tested by

no test coverage detected