From 741ae600c411f9226b5e44dfd7319741987d5181 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 Mar 2009 16:22:13 -0400 Subject: ENH: Factor out makefile progress rule commands This factors duplicate progress rule code into a common method. --- Source/cmMakefileTargetGenerator.cxx | 42 ++++++++++++++++-------------------- Source/cmMakefileTargetGenerator.h | 2 ++ 2 files changed, 20 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 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& 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) diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index c7cbab9..f743240 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -103,6 +103,8 @@ protected: void GenerateExtraOutput(const char* out, const char* in, bool symbolic = false); + void AppendProgress(std::vector& commands); + // write out the variable that lists the objects for this target void WriteObjectsVariable(std::string& variableName, std::string& variableNameExternal); -- cgit v0.12