diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2021-05-19 13:36:30 -0400 |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2021-06-04 08:52:02 -0400 |
commit | 3e7d3c252a5638d66dbbe536be79d6ed3e0e288d (patch) | |
tree | ae1d1d05c642b59871e7fdce98fdee6235a34d6f /Source/cmInstallCommand.cxx | |
parent | ed3633d88cc5faa6fd7eb68fdd774d6d1f9cfdc9 (diff) | |
download | cmake-3e7d3c252a5638d66dbbe536be79d6ed3e0e288d.tar.gz |
install(TARGETS): Add RUNTIME_DEPENDENCY_SET argument
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r-- | Source/cmInstallCommand.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index c36778d861..5d5a5a6d65 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -413,12 +413,14 @@ bool HandleTargetsMode(std::vector<std::string> const& args, std::vector<std::string> targetList; std::string exports; std::vector<std::string> runtimeDependenciesArgVector; + std::string runtimeDependencySetArg; std::vector<std::string> unknownArgs; std::vector<std::string> parsedArgs; cmInstallCommandArguments genericArgs(helper.DefaultComponentName); genericArgs.Bind("TARGETS"_s, targetList); genericArgs.Bind("EXPORT"_s, exports); genericArgs.Bind("RUNTIME_DEPENDENCIES"_s, runtimeDependenciesArgVector); + genericArgs.Bind("RUNTIME_DEPENDENCY_SET"_s, runtimeDependencySetArg); genericArgs.Parse(genericArgVector, &unknownArgs, nullptr, &parsedArgs); bool success = genericArgs.Finalize(); @@ -537,6 +539,11 @@ bool HandleTargetsMode(std::vector<std::string> const& args, cmInstallRuntimeDependencySet* runtimeDependencySet = nullptr; if (withRuntimeDependencies) { + if (!runtimeDependencySetArg.empty()) { + status.SetError("TARGETS cannot have both RUNTIME_DEPENDENCIES and " + "RUNTIME_DEPENDENCY_SET."); + return false; + } auto system = helper.Makefile->GetSafeDefinition("CMAKE_HOST_SYSTEM_NAME"); if (!cmRuntimeDependencyArchive::PlatformSupportsRuntimeDependencies( system)) { @@ -559,6 +566,18 @@ bool HandleTargetsMode(std::vector<std::string> const& args, } runtimeDependencySet = helper.Makefile->GetGlobalGenerator() ->CreateAnonymousRuntimeDependencySet(); + } else if (!runtimeDependencySetArg.empty()) { + auto system = helper.Makefile->GetSafeDefinition("CMAKE_HOST_SYSTEM_NAME"); + if (!cmRuntimeDependencyArchive::PlatformSupportsRuntimeDependencies( + system)) { + status.SetError(cmStrCat( + "TARGETS RUNTIME_DEPENDENCY_SET is not supported on system \"", system, + '"')); + return false; + } + runtimeDependencySet = + helper.Makefile->GetGlobalGenerator()->GetNamedRuntimeDependencySet( + runtimeDependencySetArg); } // Select the mode for installing symlinks to versioned shared libraries. |