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

Function HandleRuntimeDependencySetMode

Source/cmInstallCommand.cxx:2393–2507  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2391}
2392
2393bool HandleRuntimeDependencySetMode(std::vector<std::string> const& args,
2394 cmExecutionStatus& status)
2395{
2396 Helper helper(status);
2397
2398 auto system = helper.Makefile->GetSafeDefinition("CMAKE_HOST_SYSTEM_NAME");
2399 if (!cmRuntimeDependencyArchive::PlatformSupportsRuntimeDependencies(
2400 system)) {
2401 status.SetError(cmStrCat(
2402 "RUNTIME_DEPENDENCY_SET is not supported on system \"", system, '"'));
2403 return false;
2404 }
2405
2406 // This is the RUNTIME_DEPENDENCY_SET mode.
2407 cmInstallRuntimeDependencySet* runtimeDependencySet;
2408
2409 struct ArgVectors
2410 {
2411 ArgumentParser::MaybeEmpty<std::vector<std::string>> Library;
2412 ArgumentParser::MaybeEmpty<std::vector<std::string>> Runtime;
2413 ArgumentParser::MaybeEmpty<std::vector<std::string>> Framework;
2414 };
2415
2416 static auto const argHelper = cmArgumentParser<ArgVectors>{}
2417 .Bind("LIBRARY"_s, &ArgVectors::Library)
2418 .Bind("RUNTIME"_s, &ArgVectors::Runtime)
2419 .Bind("FRAMEWORK"_s, &ArgVectors::Framework);
2420
2421 std::vector<std::string> genericArgVector;
2422 ArgVectors const argVectors = argHelper.Parse(args, &genericArgVector);
2423
2424 // now parse the generic args (i.e. the ones not specialized on LIBRARY,
2425 // RUNTIME, FRAMEWORK etc. (see above)
2426 // These generic args also contain the runtime dependency set
2427 std::string runtimeDependencySetArg;
2428 std::vector<std::string> runtimeDependencyArgVector;
2429 cmInstallCommandArguments genericArgs(helper.DefaultComponentName,
2430 *helper.Makefile);
2431 genericArgs.Bind("RUNTIME_DEPENDENCY_SET"_s, runtimeDependencySetArg);
2432 genericArgs.Parse(genericArgVector, &runtimeDependencyArgVector);
2433 bool success = genericArgs.Finalize();
2434
2435 cmInstallCommandArguments libraryArgs(helper.DefaultComponentName,
2436 *helper.Makefile);
2437 cmInstallCommandArguments runtimeArgs(helper.DefaultComponentName,
2438 *helper.Makefile);
2439 cmInstallCommandArguments frameworkArgs(helper.DefaultComponentName,
2440 *helper.Makefile);
2441
2442 // Now also parse the file(GET_RUNTIME_DEPENDENCY) args
2443 std::vector<std::string> unknownArgs;
2444 auto runtimeDependencyArgs = RuntimeDependenciesArgHelper.Parse(
2445 runtimeDependencyArgVector, &unknownArgs);
2446
2447 // now parse the args for specific parts of the target (e.g. LIBRARY,
2448 // RUNTIME, FRAMEWORK etc.
2449 libraryArgs.Parse(argVectors.Library, &unknownArgs);
2450 runtimeArgs.Parse(argVectors.Runtime, &unknownArgs);

Callers

nothing calls this directly

Calls 14

moveFunction · 0.85
SetGenericArgumentsMethod · 0.80
AddInstallComponentMethod · 0.80
cmStrCatFunction · 0.70
SetErrorMethod · 0.45
BindMethod · 0.45
ParseMethod · 0.45
FinalizeMethod · 0.45
emptyMethod · 0.45
frontMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…