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

Function HandlePackageInfoMode

Source/cmInstallCommand.cxx:2318–2391  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2316}
2317
2318bool HandlePackageInfoMode(std::vector<std::string> const& args,
2319 cmExecutionStatus& status)
2320{
2321#ifndef CMAKE_BOOTSTRAP
2322 Helper helper(status);
2323
2324 // This is the PACKAGE_INFO mode.
2325 cmInstallCommandArguments ica(helper.DefaultComponentName, *helper.Makefile);
2326
2327 cmPackageInfoArguments arguments;
2328 ArgumentParser::NonEmpty<std::string> exportName;
2329 ArgumentParser::NonEmpty<std::string> cxxModulesDirectory;
2330
2331 arguments.Bind(ica);
2332 ica.Bind("EXPORT"_s, exportName);
2333 ica.Bind("CXX_MODULES_DIRECTORY"_s, cxxModulesDirectory);
2334
2335 std::vector<std::string> unknownArgs;
2336 ArgumentParser::ParseResult result = ica.Parse(args, &unknownArgs);
2337
2338 if (!result.Check(args[0], &unknownArgs, status)) {
2339 return false;
2340 }
2341
2342 if (!ica.Finalize()) {
2343 return false;
2344 }
2345
2346 if (exportName.empty()) {
2347 status.SetError(cmStrCat(args[0], " missing EXPORT."));
2348 return false;
2349 }
2350
2351 if (!arguments.Check(status) || !arguments.SetMetadataFromProject(status)) {
2352 return false;
2353 }
2354
2355 // Get or construct the destination path.
2356 std::string dest = ica.GetDestination();
2357 if (dest.empty()) {
2358 if (helper.Makefile->GetSafeDefinition("CMAKE_SYSTEM_NAME") == "Windows") {
2359 dest = arguments.GetDefaultDestination();
2360 } else {
2361 dest =
2362 arguments.GetDefaultDestination(helper.GetLibraryDestination(nullptr));
2363 }
2364 }
2365
2366 cmExportSet& exportSet =
2367 helper.Makefile->GetGlobalGenerator()->GetExportSets()[exportName];
2368
2369 cmInstallGenerator::MessageLevel message =
2370 cmInstallGenerator::SelectMessageLevel(helper.Makefile);
2371
2372 // Tell the global generator about any installation component names
2373 // specified
2374 helper.Makefile->GetGlobalGenerator()->AddInstallComponent(
2375 ica.GetComponent());

Callers

nothing calls this directly

Calls 15

moveFunction · 0.85
GetLibraryDestinationMethod · 0.80
AddInstallComponentMethod · 0.80
GetPermissionsMethod · 0.80
cmStrCatFunction · 0.70
BindMethod · 0.45
ParseMethod · 0.45
CheckMethod · 0.45
FinalizeMethod · 0.45
emptyMethod · 0.45
SetErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…