diff options
author | Brad King <brad.king@kitware.com> | 2006-05-30 20:23:24 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-05-30 20:23:24 (GMT) |
commit | d3073828f056ceb965aa33ed0c04477d3dba7fa8 (patch) | |
tree | df63bebd9456ecbd2ebd19b35a34e897de42db00 /Source/cmGlobalUnixMakefileGenerator3.cxx | |
parent | d9e060e0625edfe523210f66e023b3367f5a2775 (diff) | |
download | CMake-d3073828f056ceb965aa33ed0c04477d3dba7fa8.zip CMake-d3073828f056ceb965aa33ed0c04477d3dba7fa8.tar.gz CMake-d3073828f056ceb965aa33ed0c04477d3dba7fa8.tar.bz2 |
BUG: Fix progress when total number of source files is less than 100.
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 037fb68..b7f6797 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -703,15 +703,23 @@ cmGlobalUnixMakefileGenerator3 std::string progressDir = lg->GetMakefile()->GetHomeOutputDirectory(); progressDir += "/CMakeFiles"; + + { + // TODO: Convert the total progress count to a make variable. cmOStringStream progCmd; - progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; + progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # in target progCmd << lg->Convert(progressDir.c_str(), cmLocalGenerator::FULL, cmLocalGenerator::SHELL); + int n = this->GetNumberOfSourceFiles(); + if(n > 100) + { + n = 100; + } if (this->NumberOfSourceFiles) { progCmd << " " << - (100*this->GetTargetTotalNumberOfSourceFiles(t->second))/ + (n*this->GetTargetTotalNumberOfSourceFiles(t->second))/ this->NumberOfSourceFiles; } else @@ -719,9 +727,19 @@ cmGlobalUnixMakefileGenerator3 progCmd << " 0"; } commands.push_back(progCmd.str()); + } commands.push_back(lg->GetRecursiveMakeCall ("CMakeFiles/Makefile2",t->second.GetName())); - depends.clear(); + { + cmOStringStream progCmd; + progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 + progCmd << lg->Convert(progressDir.c_str(), + cmLocalGenerator::FULL, + cmLocalGenerator::SHELL); + progCmd << " 0"; + commands.push_back(progCmd.str()); + } + depends.clear(); depends.push_back("cmake_check_build_system"); lg->WriteMakeRule(ruleFileStream, "Build rule for target.", @@ -840,7 +858,7 @@ cmGlobalUnixMakefileGenerator3 lg->GetMakefile()->GetHomeOutputDirectory(); progressDir += "/CMakeFiles"; cmOStringStream progCmd; - progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report "; + progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report "; // all target counts progCmd << lg->Convert(progressDir.c_str(), cmLocalGenerator::FULL, cmLocalGenerator::SHELL); |