|
@@ -924,20 +924,6 @@ int do_install(int ac, char const* const* av)
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
- cmake cm(cmake::RoleScript, cmState::Script);
|
|
|
-
|
|
|
- cmSystemTools::SetMessageCallback(
|
|
|
- [&cm](const std::string& msg, const cmMessageMetadata& md) {
|
|
|
- cmakemainMessageCallback(msg, md, &cm);
|
|
|
- });
|
|
|
- cm.SetProgressCallback([&cm](const std::string& msg, float prog) {
|
|
|
- cmakemainProgressCallback(msg, prog, &cm);
|
|
|
- });
|
|
|
- cm.SetHomeDirectory("");
|
|
|
- cm.SetHomeOutputDirectory("");
|
|
|
- cm.SetDebugOutputOn(verbose);
|
|
|
- cm.SetWorkingMode(cmake::SCRIPT_MODE);
|
|
|
-
|
|
|
std::vector<std::string> args{ av[0] };
|
|
|
|
|
|
if (!prefix.empty()) {
|
|
@@ -952,10 +938,6 @@ int do_install(int ac, char const* const* av)
|
|
|
args.emplace_back("-DCMAKE_INSTALL_DO_STRIP=1");
|
|
|
}
|
|
|
|
|
|
- if (!config.empty()) {
|
|
|
- args.emplace_back("-DCMAKE_INSTALL_CONFIG_NAME=" + config);
|
|
|
- }
|
|
|
-
|
|
|
if (!defaultDirectoryPermissions.empty()) {
|
|
|
std::string parsedPermissionsVar;
|
|
|
if (!parse_default_directory_permissions(defaultDirectoryPermissions,
|
|
@@ -970,25 +952,38 @@ int do_install(int ac, char const* const* av)
|
|
|
|
|
|
args.emplace_back("-P");
|
|
|
|
|
|
- auto handler = cmInstallScriptHandler(dir, component, args);
|
|
|
+ auto handler = cmInstallScriptHandler(dir, component, config, args);
|
|
|
int ret = 0;
|
|
|
- if (!handler.isParallel()) {
|
|
|
- args.emplace_back(cmStrCat(dir, "/cmake_install.cmake"));
|
|
|
- ret = int(bool(cm.Run(args)));
|
|
|
- } else {
|
|
|
- if (!jobs) {
|
|
|
- jobs = 1;
|
|
|
- auto envvar = cmSystemTools::GetEnvVar("CMAKE_INSTALL_PARALLEL_LEVEL");
|
|
|
- if (envvar.has_value()) {
|
|
|
- jobs = extract_job_number("", envvar.value());
|
|
|
- if (jobs < 1) {
|
|
|
- std::cerr << "Value of CMAKE_INSTALL_PARALLEL_LEVEL environment"
|
|
|
- " variable must be a positive integer.\n";
|
|
|
- return 1;
|
|
|
- }
|
|
|
+ if (!jobs && handler.IsParallel()) {
|
|
|
+ jobs = 1;
|
|
|
+ auto envvar = cmSystemTools::GetEnvVar("CMAKE_INSTALL_PARALLEL_LEVEL");
|
|
|
+ if (envvar.has_value()) {
|
|
|
+ jobs = extract_job_number("", envvar.value());
|
|
|
+ if (jobs < 1) {
|
|
|
+ std::cerr << "Value of CMAKE_INSTALL_PARALLEL_LEVEL environment"
|
|
|
+ " variable must be a positive integer.\n";
|
|
|
+ return 1;
|
|
|
}
|
|
|
}
|
|
|
- ret = handler.install(jobs);
|
|
|
+ }
|
|
|
+ if (handler.IsParallel()) {
|
|
|
+ ret = handler.Install(jobs);
|
|
|
+ } else {
|
|
|
+ for (auto const& cmd : handler.GetCommands()) {
|
|
|
+ cmake cm(cmake::RoleScript, cmState::Script);
|
|
|
+ cmSystemTools::SetMessageCallback(
|
|
|
+ [&cm](const std::string& msg, const cmMessageMetadata& md) {
|
|
|
+ cmakemainMessageCallback(msg, md, &cm);
|
|
|
+ });
|
|
|
+ cm.SetProgressCallback([&cm](const std::string& msg, float prog) {
|
|
|
+ cmakemainProgressCallback(msg, prog, &cm);
|
|
|
+ });
|
|
|
+ cm.SetHomeDirectory("");
|
|
|
+ cm.SetHomeOutputDirectory("");
|
|
|
+ cm.SetDebugOutputOn(verbose);
|
|
|
+ cm.SetWorkingMode(cmake::SCRIPT_MODE);
|
|
|
+ ret = int(bool(cm.Run(cmd)));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return int(ret > 0);
|