summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/CPack/cmCPackGenerator.cxx2
-rw-r--r--Source/CTest/cmCTestBuildCommand.cxx4
-rw-r--r--Source/cmBuildCommand.cxx4
-rw-r--r--Source/cmGlobalGenerator.cxx7
-rw-r--r--Source/cmGlobalGenerator.h6
5 files changed, 16 insertions, 7 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index c512a36..cd2adaa 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -694,7 +694,7 @@ int cmCPackGenerator::RunPreinstallTarget(
// Does this generator require pre-install?
if (const char* preinstall = globalGenerator->GetPreinstallTargetName()) {
std::string buildCommand = globalGenerator->GenerateCMakeBuildCommand(
- preinstall, buildConfig, "", false);
+ preinstall, buildConfig, "", "", false);
cmCPackLogger(cmCPackLog::LOG_DEBUG,
"- Install command: " << buildCommand << std::endl);
cmCPackLogger(cmCPackLog::LOG_OUTPUT,
diff --git a/Source/CTest/cmCTestBuildCommand.cxx b/Source/CTest/cmCTestBuildCommand.cxx
index 88e2871..099d1e2 100644
--- a/Source/CTest/cmCTestBuildCommand.cxx
+++ b/Source/CTest/cmCTestBuildCommand.cxx
@@ -98,8 +98,8 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
std::string dir = this->CTest->GetCTestConfiguration("BuildDirectory");
std::string buildCommand =
this->GlobalGenerator->GenerateCMakeBuildCommand(
- cmakeBuildTarget, cmakeBuildConfiguration, cmakeBuildAdditionalFlags,
- this->Makefile->IgnoreErrorsCMP0061());
+ cmakeBuildTarget, cmakeBuildConfiguration, "",
+ cmakeBuildAdditionalFlags, this->Makefile->IgnoreErrorsCMP0061());
cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
"SetMakeCommand:" << buildCommand << "\n",
this->Quiet);
diff --git a/Source/cmBuildCommand.cxx b/Source/cmBuildCommand.cxx
index 2eaf315..4830343 100644
--- a/Source/cmBuildCommand.cxx
+++ b/Source/cmBuildCommand.cxx
@@ -77,7 +77,7 @@ bool MainSignature(std::vector<std::string> const& args,
}
std::string makecommand = mf.GetGlobalGenerator()->GenerateCMakeBuildCommand(
- target, configuration, "", mf.IgnoreErrorsCMP0061());
+ target, configuration, "", "", mf.IgnoreErrorsCMP0061());
mf.AddDefinition(variable, makecommand);
@@ -104,7 +104,7 @@ bool TwoArgsSignature(std::vector<std::string> const& args,
}
std::string makecommand = mf.GetGlobalGenerator()->GenerateCMakeBuildCommand(
- "", configType, "", mf.IgnoreErrorsCMP0061());
+ "", configType, "", "", mf.IgnoreErrorsCMP0061());
if (cacheValue) {
return true;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index ab76260..55fba79 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2077,7 +2077,7 @@ bool cmGlobalGenerator::Open(const std::string& bindir,
std::string cmGlobalGenerator::GenerateCMakeBuildCommand(
const std::string& target, const std::string& config,
- const std::string& native, bool ignoreErrors)
+ const std::string& parallel, const std::string& native, bool ignoreErrors)
{
std::string makeCommand = cmSystemTools::GetCMakeCommand();
makeCommand =
@@ -2087,6 +2087,11 @@ std::string cmGlobalGenerator::GenerateCMakeBuildCommand(
makeCommand += config;
makeCommand += "\"";
}
+ if (!parallel.empty()) {
+ makeCommand += " --parallel \"";
+ makeCommand += parallel;
+ makeCommand += "\"";
+ }
if (!target.empty()) {
makeCommand += " --target \"";
makeCommand += target;
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 590de26..fee0359 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -249,9 +249,13 @@ public:
virtual void PrintBuildCommandAdvice(std::ostream& os, int jobs) const;
- /** Generate a "cmake --build" call for a given target and config. */
+ /**
+ * Generate a "cmake --build" call for a given target, config and parallel
+ * level.
+ */
std::string GenerateCMakeBuildCommand(const std::string& target,
const std::string& config,
+ const std::string& parallel,
const std::string& native,
bool ignoreErrors);