ENH: some cleanup to progress
This commit is contained in:
parent
a21a320a26
commit
14cc1efe2c
|
@ -860,11 +860,11 @@ cmGlobalUnixMakefileGenerator3
|
||||||
{
|
{
|
||||||
progCmd << " " << *i;
|
progCmd << " " << *i;
|
||||||
}
|
}
|
||||||
if (progFiles.size())
|
commands.push_back(progCmd.str());
|
||||||
{
|
progressDir = "Building target ";
|
||||||
commands.push_back(progCmd.str());
|
progressDir += t->first;
|
||||||
}
|
lg->AppendEcho(commands,progressDir.c_str());
|
||||||
|
|
||||||
this->AppendGlobalTargetDepends(depends,t->second);
|
this->AppendGlobalTargetDepends(depends,t->second);
|
||||||
lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
|
lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
|
||||||
localName.c_str(), depends, commands, true);
|
localName.c_str(), depends, commands, true);
|
||||||
|
|
|
@ -408,20 +408,21 @@ cmMakefileTargetGenerator
|
||||||
cmGlobalUnixMakefileGenerator3* gg =
|
cmGlobalUnixMakefileGenerator3* gg =
|
||||||
static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
|
static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator);
|
||||||
int prog = gg->ShouldAddProgressRule();
|
int prog = gg->ShouldAddProgressRule();
|
||||||
|
|
||||||
|
std::string progressDir = this->Makefile->GetHomeOutputDirectory();
|
||||||
|
progressDir += "/CMakeFiles";
|
||||||
|
cmOStringStream progCmd;
|
||||||
|
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
|
||||||
|
progCmd << this->LocalGenerator->Convert(progressDir.c_str(),
|
||||||
|
cmLocalGenerator::FULL,
|
||||||
|
cmLocalGenerator::SHELL);
|
||||||
if (prog)
|
if (prog)
|
||||||
{
|
{
|
||||||
std::string progressDir = this->Makefile->GetHomeOutputDirectory();
|
|
||||||
progressDir += "/CMakeFiles";
|
|
||||||
cmOStringStream progCmd;
|
|
||||||
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
|
|
||||||
progCmd << this->LocalGenerator->Convert(progressDir.c_str(),
|
|
||||||
cmLocalGenerator::FULL,
|
|
||||||
cmLocalGenerator::SHELL);
|
|
||||||
progCmd << " " << prog;
|
progCmd << " " << prog;
|
||||||
commands.push_back(progCmd.str());
|
|
||||||
this->LocalGenerator->ProgressFiles[this->Target->GetName()].
|
this->LocalGenerator->ProgressFiles[this->Target->GetName()].
|
||||||
push_back(prog);
|
push_back(prog);
|
||||||
}
|
}
|
||||||
|
commands.push_back(progCmd.str());
|
||||||
|
|
||||||
// Construct the compile rules.
|
// Construct the compile rules.
|
||||||
std::string compileRuleVar = "CMAKE_";
|
std::string compileRuleVar = "CMAKE_";
|
||||||
|
|
|
@ -1004,7 +1004,7 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Command to report progress for a build
|
// Command to report progress for a build
|
||||||
else if (args[1] == "cmake_progress_report" && args.size() >= 4)
|
else if (args[1] == "cmake_progress_report" && args.size() >= 3)
|
||||||
{
|
{
|
||||||
std::string dirName = args[2];
|
std::string dirName = args[2];
|
||||||
dirName += "/Progress";
|
dirName += "/Progress";
|
||||||
|
@ -1037,7 +1037,7 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
// print the progress
|
// print the progress
|
||||||
fprintf(stdout,"%3i%% complete\n",((fileNum-3)*100)/count);
|
fprintf(stdout,"[%3i%%] ",((fileNum-3)*100)/count);
|
||||||
}
|
}
|
||||||
fclose(progFile);
|
fclose(progFile);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue