diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 88521dd9d..130aebe74 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -33,7 +33,6 @@ cmMakefileTargetGenerator::cmMakefileTargetGenerator() { this->BuildFileStream = 0; - this->ProgressFileStream = 0; this->InfoFileStream = 0; this->FlagFileStream = 0; } @@ -92,13 +91,6 @@ void cmMakefileTargetGenerator::CreateRuleFile() this->ProgressFileNameFull = this->TargetBuildDirectoryFull; this->ProgressFileNameFull += "/progress.make"; - this->ProgressFileStream = - new cmGeneratedFileStream(this->ProgressFileNameFull.c_str()); - if(!this->ProgressFileStream) - { - return; - } - // reset the progress count this->NumberOfProgressActions = 0; @@ -1055,29 +1047,36 @@ void cmMakefileTargetGenerator::RemoveForbiddenFlags(const char* flagVar, void cmMakefileTargetGenerator::WriteProgressVariables(unsigned long total, unsigned long ¤t) { + cmGeneratedFileStream *progressFileStream = + new cmGeneratedFileStream(this->ProgressFileNameFull.c_str()); + if(!progressFileStream) + { + return; + } + unsigned long num; unsigned long i; for (i = 1; i <= this->NumberOfProgressActions; ++i) { - *this->ProgressFileStream + *progressFileStream << "CMAKE_PROGRESS_" << i << " = "; if (total <= 100) { num = i + current; - *this->ProgressFileStream << num; + *progressFileStream << num; this->LocalGenerator->ProgressFiles[this->Target->GetName()] .push_back(num); } else if (((i+current)*100)/total > ((i-1+current)*100)/total) { num = ((i+current)*100)/total; - *this->ProgressFileStream << num; + *progressFileStream << num; this->LocalGenerator->ProgressFiles[this->Target->GetName()] .push_back(num); } - *this->ProgressFileStream << "\n"; + *progressFileStream << "\n"; } current += this->NumberOfProgressActions; - delete this->ProgressFileStream; + delete progressFileStream; } diff --git a/Source/cmMakefileTargetGenerator.h b/Source/cmMakefileTargetGenerator.h index 9c615c439..02223e6de 100644 --- a/Source/cmMakefileTargetGenerator.h +++ b/Source/cmMakefileTargetGenerator.h @@ -129,8 +129,6 @@ protected: // the full path to the progress file std::string ProgressFileName; std::string ProgressFileNameFull; - // the stream for the build file - cmGeneratedFileStream *ProgressFileStream; unsigned long NumberOfProgressActions; // the path to the directory the build file is in