summaryrefslogtreecommitdiffstats
path: root/Source/cmInstallCommand.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2021-06-02 14:30:55 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2021-06-04 12:52:02 (GMT)
commitbc8a4a06a488a0cfd260901acf189e91c8906dbd (patch)
tree996e09a3cb1e07448fad2627a8d55fa59ab71cd0 /Source/cmInstallCommand.cxx
parent3e7d3c252a5638d66dbbe536be79d6ed3e0e288d (diff)
downloadCMake-bc8a4a06a488a0cfd260901acf189e91c8906dbd.zip
CMake-bc8a4a06a488a0cfd260901acf189e91c8906dbd.tar.gz
CMake-bc8a4a06a488a0cfd260901acf189e91c8906dbd.tar.bz2
install(IMPORTED_RUNTIME_ARTIFACTS): Add RUNTIME_DEPENDENCY_SET option
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r--Source/cmInstallCommand.cxx41
1 files changed, 40 insertions, 1 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 5d5a5a6..67451aa 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -1098,9 +1098,11 @@ bool HandleImportedRuntimeArtifactsMode(std::vector<std::string> const& args,
// now parse the generic args (i.e. the ones not specialized on LIBRARY,
// RUNTIME etc. (see above)
std::vector<std::string> targetList;
+ std::string runtimeDependencySetArg;
std::vector<std::string> unknownArgs;
cmInstallCommandArguments genericArgs(helper.DefaultComponentName);
- genericArgs.Bind("IMPORTED_RUNTIME_ARTIFACTS"_s, targetList);
+ genericArgs.Bind("IMPORTED_RUNTIME_ARTIFACTS"_s, targetList)
+ .Bind("RUNTIME_DEPENDENCY_SET"_s, runtimeDependencySetArg);
genericArgs.Parse(genericArgVector, &unknownArgs);
bool success = genericArgs.Finalize();
@@ -1139,6 +1141,22 @@ bool HandleImportedRuntimeArtifactsMode(std::vector<std::string> const& args,
return false;
}
+ cmInstallRuntimeDependencySet* runtimeDependencySet = nullptr;
+ if (!runtimeDependencySetArg.empty()) {
+ auto system = helper.Makefile->GetSafeDefinition("CMAKE_HOST_SYSTEM_NAME");
+ if (!cmRuntimeDependencyArchive::PlatformSupportsRuntimeDependencies(
+ system)) {
+ status.SetError(
+ cmStrCat("IMPORTED_RUNTIME_ARTIFACTS RUNTIME_DEPENDENCY_SET is not "
+ "supported on system \"",
+ system, '"'));
+ return false;
+ }
+ runtimeDependencySet =
+ helper.Makefile->GetGlobalGenerator()->GetNamedRuntimeDependencySet(
+ runtimeDependencySetArg);
+ }
+
// Check if there is something to do.
if (targetList.empty()) {
return true;
@@ -1217,6 +1235,9 @@ bool HandleImportedRuntimeArtifactsMode(std::vector<std::string> const& args,
if (target.IsDLLPlatform()) {
runtimeGenerator = createInstallGenerator(
target, runtimeArgs, helper.GetRuntimeDestination(&runtimeArgs));
+ if (runtimeDependencySet) {
+ runtimeDependencySet->AddLibrary(runtimeGenerator.get());
+ }
} else if (target.IsFrameworkOnApple()) {
if (frameworkArgs.GetDestination().empty()) {
status.SetError(cmStrCat("IMPORTED_RUNTIME_ARTIFACTS given no "
@@ -1227,14 +1248,23 @@ bool HandleImportedRuntimeArtifactsMode(std::vector<std::string> const& args,
}
frameworkGenerator = createInstallGenerator(
target, frameworkArgs, frameworkArgs.GetDestination());
+ if (runtimeDependencySet) {
+ runtimeDependencySet->AddLibrary(frameworkGenerator.get());
+ }
} else {
libraryGenerator = createInstallGenerator(
target, libraryArgs, helper.GetLibraryDestination(&libraryArgs));
+ if (runtimeDependencySet) {
+ runtimeDependencySet->AddLibrary(libraryGenerator.get());
+ }
}
break;
case cmStateEnums::MODULE_LIBRARY:
libraryGenerator = createInstallGenerator(
target, libraryArgs, helper.GetLibraryDestination(&libraryArgs));
+ if (runtimeDependencySet) {
+ runtimeDependencySet->AddModule(libraryGenerator.get());
+ }
break;
case cmStateEnums::EXECUTABLE:
if (target.IsAppBundleOnApple()) {
@@ -1247,9 +1277,18 @@ bool HandleImportedRuntimeArtifactsMode(std::vector<std::string> const& args,
}
bundleGenerator = createInstallGenerator(
target, bundleArgs, bundleArgs.GetDestination());
+ if (runtimeDependencySet) {
+ if (!AddBundleExecutable(helper, runtimeDependencySet,
+ bundleGenerator.get())) {
+ return false;
+ }
+ }
} else {
runtimeGenerator = createInstallGenerator(
target, runtimeArgs, helper.GetRuntimeDestination(&runtimeArgs));
+ if (runtimeDependencySet) {
+ runtimeDependencySet->AddExecutable(runtimeGenerator.get());
+ }
}
break;
default: