summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-01 16:41:00 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-12-01 16:41:00 (GMT)
commit782bef73746cce51a000effd72f16b2fbb3d3d8a (patch)
treea529545cc540245b811534b506c762d4e18b15fe /Source/cmGlobalGenerator.cxx
parente95224b2e747c8eacba178c37a9ad5c5c055cbf4 (diff)
downloadCMake-782bef73746cce51a000effd72f16b2fbb3d3d8a.zip
CMake-782bef73746cce51a000effd72f16b2fbb3d3d8a.tar.gz
CMake-782bef73746cce51a000effd72f16b2fbb3d3d8a.tar.bz2
ENH: Add a way for the generated command to include extra flags. This is useful for CTest (or try compile) to add -j2
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index bf80555..8a976ab 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -719,8 +719,8 @@ int cmGlobalGenerator::TryCompile(const char *srcdir, const char *bindir,
}
std::string cmGlobalGenerator::GenerateBuildCommand(const char* makeProgram,
- const char *projectName, const char *targetName, const char* config,
- bool ignoreErrors)
+ const char *projectName, const char* additionalOptions, const char *targetName,
+ const char* config, bool ignoreErrors)
{
// Project name and config are not used yet.
(void)projectName;
@@ -738,6 +738,11 @@ std::string cmGlobalGenerator::GenerateBuildCommand(const char* makeProgram,
{
makeCommand += " -i";
}
+ if ( additionalOptions )
+ {
+ makeCommand += " ";
+ makeCommand += additionalOptions;
+ }
if ( targetName )
{
makeCommand += " ";
@@ -770,7 +775,8 @@ int cmGlobalGenerator::Build(
// should we do a clean first?
if (clean)
{
- std::string cleanCommand = this->GenerateBuildCommand(makeCommandCSTR, projectName, "clean", config, false);
+ std::string cleanCommand = this->GenerateBuildCommand(makeCommandCSTR, projectName,
+ 0, "clean", config, false);
if (!cmSystemTools::RunSingleCommand(cleanCommand.c_str(), output,
&retVal, 0, false, timeout))
{
@@ -788,7 +794,8 @@ int cmGlobalGenerator::Build(
}
// now build
- std::string makeCommand = this->GenerateBuildCommand(makeCommandCSTR, projectName, target, config, false);
+ std::string makeCommand = this->GenerateBuildCommand(makeCommandCSTR, projectName,
+ 0, target, config, false);
if (!cmSystemTools::RunSingleCommand(makeCommand.c_str(), output,
&retVal, 0, false, timeout))