diff options
author | Ken Martin <ken.martin@kitware.com> | 2006-05-25 14:55:24 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2006-05-25 14:55:24 (GMT) |
commit | 7eba286403b8f0e69f6787800b6e4ec09ccc2f39 (patch) | |
tree | b55582f4b2c0630c587260d6d0e15beba19b813f /Source/cmGlobalUnixMakefileGenerator3.cxx | |
parent | 60ebc572279f5459d946e716cf6f707b9e22785e (diff) | |
download | CMake-7eba286403b8f0e69f6787800b6e4ec09ccc2f39.zip CMake-7eba286403b8f0e69f6787800b6e4ec09ccc2f39.tar.gz CMake-7eba286403b8f0e69f6787800b6e4ec09ccc2f39.tar.bz2 |
BUG: fix to progress for small projects
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 13bf515..037fb68 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -117,7 +117,8 @@ cmGlobalUnixMakefileGenerator3 int cmGlobalUnixMakefileGenerator3::ShouldAddProgressRule() { // add progress to 100 source files - if ((((this->NumberOfSourceFilesWritten + 1)*100)/this->NumberOfSourceFiles) + if (this->NumberOfSourceFiles && + (((this->NumberOfSourceFilesWritten + 1)*100)/this->NumberOfSourceFiles) -(this->NumberOfSourceFilesWritten*100)/this->NumberOfSourceFiles) { this->NumberOfSourceFilesWritten++; @@ -173,9 +174,8 @@ GetNumberOfCompilableSourceFilesForTarget(cmTarget &tgt) //---------------------------------------------------------------------------- void cmGlobalUnixMakefileGenerator3::Generate() { - // initialize progress, always pretend there is at least 1 file - // to avoid division errors etc - this->NumberOfSourceFiles = 1; + // initialize progress + this->NumberOfSourceFiles = 0; unsigned int i; for (i = 0; i < this->LocalGenerators.size(); ++i) { @@ -708,9 +708,16 @@ cmGlobalUnixMakefileGenerator3 progCmd << lg->Convert(progressDir.c_str(), cmLocalGenerator::FULL, cmLocalGenerator::SHELL); - progCmd << " " << - (100*this->GetTargetTotalNumberOfSourceFiles(t->second))/ - this->NumberOfSourceFiles; + if (this->NumberOfSourceFiles) + { + progCmd << " " << + (100*this->GetTargetTotalNumberOfSourceFiles(t->second))/ + this->NumberOfSourceFiles; + } + else + { + progCmd << " 0"; + } commands.push_back(progCmd.str()); commands.push_back(lg->GetRecursiveMakeCall ("CMakeFiles/Makefile2",t->second.GetName())); |