summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-03-16 20:22:13 (GMT)
committerBrad King <brad.king@kitware.com>2009-03-16 20:22:13 (GMT)
commit741ae600c411f9226b5e44dfd7319741987d5181 (patch)
tree1e813824e1b54ff73763d140afb14b8448f7df5b /Source/cmMakefileTargetGenerator.cxx
parent7b9b56d80e330dcf32fe2dc9e8956528f736ab4c (diff)
downloadCMake-741ae600c411f9226b5e44dfd7319741987d5181.zip
CMake-741ae600c411f9226b5e44dfd7319741987d5181.tar.gz
CMake-741ae600c411f9226b5e44dfd7319741987d5181.tar.bz2
ENH: Factor out makefile progress rule commands
This factors duplicate progress rule code into a common method.
Diffstat (limited to 'Source/cmMakefileTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileTargetGenerator.cxx42
1 files changed, 18 insertions, 24 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index cbc8fd5..b8b9141 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -580,18 +580,7 @@ cmMakefileTargetGenerator
std::vector<std::string> commands;
// add in a progress call if needed
- std::string progressDir = this->Makefile->GetHomeOutputDirectory();
- progressDir += cmake::GetCMakeFilesDirectory();
- cmOStringStream progCmd;
- progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
- progCmd << this->LocalGenerator->Convert(progressDir.c_str(),
- cmLocalGenerator::FULL,
- cmLocalGenerator::SHELL);
- this->NumberOfProgressActions++;
- progCmd << " $(CMAKE_PROGRESS_"
- << this->NumberOfProgressActions
- << ")";
- commands.push_back(progCmd.str());
+ this->AppendProgress(commands);
std::string buildEcho = "Building ";
buildEcho += lang;
@@ -1107,18 +1096,7 @@ void cmMakefileTargetGenerator
if(!comment.empty())
{
// add in a progress call if needed
- std::string progressDir = this->Makefile->GetHomeOutputDirectory();
- progressDir += cmake::GetCMakeFilesDirectory();
- cmOStringStream progCmd;
- progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
- progCmd << this->LocalGenerator->Convert(progressDir.c_str(),
- cmLocalGenerator::FULL,
- cmLocalGenerator::SHELL);
- this->NumberOfProgressActions++;
- progCmd << " $(CMAKE_PROGRESS_"
- << this->NumberOfProgressActions
- << ")";
- commands.push_back(progCmd.str());
+ this->AppendProgress(commands);
this->LocalGenerator
->AppendEcho(commands, comment.c_str(),
cmLocalUnixMakefileGenerator3::EchoGenerate);
@@ -1219,6 +1197,22 @@ cmMakefileTargetGenerator
//----------------------------------------------------------------------------
void
+cmMakefileTargetGenerator::AppendProgress(std::vector<std::string>& commands)
+{
+ this->NumberOfProgressActions++;
+ std::string progressDir = this->Makefile->GetHomeOutputDirectory();
+ progressDir += cmake::GetCMakeFilesDirectory();
+ cmOStringStream progCmd;
+ progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
+ progCmd << this->LocalGenerator->Convert(progressDir.c_str(),
+ cmLocalGenerator::FULL,
+ cmLocalGenerator::SHELL);
+ progCmd << " $(CMAKE_PROGRESS_" << this->NumberOfProgressActions << ")";
+ commands.push_back(progCmd.str());
+}
+
+//----------------------------------------------------------------------------
+void
cmMakefileTargetGenerator
::WriteObjectsVariable(std::string& variableName,
std::string& variableNameExternal)