ENH: Factor out makefile progress rule commands
This factors duplicate progress rule code into a common method.
This commit is contained in:
parent
7b9b56d80e
commit
741ae600c4
|
@ -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);
|
||||
|
@ -1217,6 +1195,22 @@ cmMakefileTargetGenerator
|
|||
this->AddMultipleOutputPair(out, in);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
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
|
||||
|
|
|
@ -103,6 +103,8 @@ protected:
|
|||
void GenerateExtraOutput(const char* out, const char* in,
|
||||
bool symbolic = false);
|
||||
|
||||
void AppendProgress(std::vector<std::string>& commands);
|
||||
|
||||
// write out the variable that lists the objects for this target
|
||||
void WriteObjectsVariable(std::string& variableName,
|
||||
std::string& variableNameExternal);
|
||||
|
|
Loading…
Reference in New Issue