Attached Files | quiet_progress_count.diff [^] (1,250 bytes) 1969-12-31 19:00 [Show Content] [Hide Content]diff -ruN cmake-2.4.6-original/Source/cmake.cxx cmake-2.4.6-patched/Source/cmake.cxx
--- cmake-2.4.6-original/Source/cmake.cxx 2007-07-10 17:44:03.000016000 +0200
+++ cmake-2.4.6-patched/Source/cmake.cxx 2007-07-10 18:07:00.000012000 +0200
@@ -988,10 +988,14 @@
return 1;
}
-
// Command to start progress for a build
else if (args[1] == "cmake_progress_start" && args.size() == 4)
{
+ bool quiet_progress = cmSystemTools::GetEnv("DISABLE_PROGRESS_COUNT") != 0;
+ if (quiet_progress)
+ {
+ return 0;
+ }
// bascially remove the directory
std::string dirName = args[2];
dirName += "/Progress";
@@ -1016,6 +1020,11 @@
// Command to report progress for a build
else if (args[1] == "cmake_progress_report" && args.size() >= 3)
{
+ bool quiet_progress = cmSystemTools::GetEnv("DISABLE_PROGRESS_COUNT") != 0;
+ if (quiet_progress)
+ {
+ return 0;
+ }
std::string dirName = args[2];
dirName += "/Progress";
std::string fName;
@@ -1057,7 +1066,6 @@
}
return 0;
}
-
// Command to create a symbolic link. Fails on platforms not
// supporting them.
else if (args[1] == "create_symlink" && args.size() == 4)
cmake_progress_count.diff [^] (9,316 bytes) 1969-12-31 19:00 [Show Content] [Hide Content]diff -ruN cmake-2.4.6-original/Modules/CMakeGenericSystem.cmake cmake-2.4.6-patched/Modules/CMakeGenericSystem.cmake
--- cmake-2.4.6-original/Modules/CMakeGenericSystem.cmake 2007-07-11 06:09:41.000005000 +0200
+++ cmake-2.4.6-patched/Modules/CMakeGenericSystem.cmake 2007-07-11 07:06:35.000002000 +0200
@@ -41,6 +41,13 @@
MARK_AS_ADVANCED(CMAKE_COLOR_MAKEFILE)
ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
+IF(CMAKE_GENERATOR MATCHES "Makefiles")
+SET(CMAKE_PROGRESS_COUNT ON CACHE BOOL
+ "Enable/Disable output of build progress."
+ )
+MARK_AS_ADVANCED(CMAKE_PROGRESS_COUNT)
+ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
+
# Set a variable to indicate whether the value of CMAKE_INSTALL_PREFIX
# was initialized by the block below. This is useful for user
# projects to change the default prefix while still allowing the
diff -ruN cmake-2.4.6-original/Source/cmGlobalUnixMakefileGenerator3.cxx cmake-2.4.6-patched/Source/cmGlobalUnixMakefileGenerator3.cxx
--- cmake-2.4.6-original/Source/cmGlobalUnixMakefileGenerator3.cxx 2007-07-10 21:49:08.000024000 +0200
+++ cmake-2.4.6-patched/Source/cmGlobalUnixMakefileGenerator3.cxx 2007-07-11 07:07:50.000010000 +0200
@@ -764,7 +764,10 @@
localName += "/all";
depends.clear();
- std::string progressDir =
+ std::string progressDir;
+ if(lg->GetMakefile()->IsOn("CMAKE_PROGRESS_COUNT"))
+ {
+ progressDir =
lg->GetMakefile()->GetHomeOutputDirectory();
progressDir += cmake::GetCMakeFilesDirectory();
{
@@ -786,7 +789,7 @@
progressDir = "Built target ";
progressDir += t->first;
lg->AppendEcho(commands,progressDir.c_str());
-
+ }
this->AppendGlobalTargetDepends(depends,t->second);
lg->WriteMakeRule(ruleFileStream, "All Build rule for target.",
localName.c_str(), depends, commands, true);
@@ -803,9 +806,10 @@
// Write the rule.
commands.clear();
- progressDir = lg->GetMakefile()->GetHomeOutputDirectory();
- progressDir += cmake::GetCMakeFilesDirectory();
-
+
+ progressDir = lg->GetMakefile()->GetHomeOutputDirectory();
+ progressDir += cmake::GetCMakeFilesDirectory();
+ if(lg->GetMakefile()->IsOn("CMAKE_PROGRESS_COUNT"))
{
// TODO: Convert the total progress count to a make variable.
cmOStringStream progCmd;
@@ -820,11 +824,12 @@
<< this->GetTargetTotalNumberOfActions(t->second,
emitted);
commands.push_back(progCmd.str());
- }
+ }
std::string tmp = cmake::GetCMakeFilesDirectoryPostSlash();
tmp += "Makefile2";
commands.push_back(lg->GetRecursiveMakeCall
(tmp.c_str(),localName.c_str()));
+ if(lg->GetMakefile()->IsOn("CMAKE_PROGRESS_COUNT"))
{
cmOStringStream progCmd;
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0
diff -ruN cmake-2.4.6-original/Source/cmLocalUnixMakefileGenerator3.cxx cmake-2.4.6-patched/Source/cmLocalUnixMakefileGenerator3.cxx
--- cmake-2.4.6-original/Source/cmLocalUnixMakefileGenerator3.cxx 2007-07-10 21:48:54.000012000 +0200
+++ cmake-2.4.6-patched/Source/cmLocalUnixMakefileGenerator3.cxx 2007-07-11 07:07:14.000014000 +0200
@@ -82,6 +82,7 @@
// Record whether some options are enabled to avoid checking many
// times later.
this->ColorMakefile = this->Makefile->IsOn("CMAKE_COLOR_MAKEFILE");
+ this->ProgressCount = this->Makefile->IsOn("CMAKE_PROGRESS_COUNT");
this->SkipPreprocessedSourceRules =
this->Makefile->IsOn("CMAKE_SKIP_PREPROCESSED_SOURCE_RULES");
this->SkipAssemblySourceRules =
@@ -1389,17 +1390,19 @@
this->WriteSpecialTargetsTop(ruleFileStream);
// Include the progress variables for the target.
- std::string progressFile = cmake::GetCMakeFilesDirectory();
- progressFile += "/progress.make";
- std::string progressFileNameFull =
+ if(this->ProgressCount)
+ {
+ std::string progressFile = cmake::GetCMakeFilesDirectory();
+ progressFile += "/progress.make";
+ std::string progressFileNameFull =
this->ConvertToFullPath(progressFile.c_str());
- ruleFileStream
- << "# Include the progress variables for this target.\n"
- << this->IncludeDirective << " "
- << this->Convert(progressFileNameFull.c_str(),
- cmLocalGenerator::START_OUTPUT,
- cmLocalGenerator::MAKEFILE) << "\n\n";
-
+ ruleFileStream
+ << "# Include the progress variables for this target.\n"
+ << this->IncludeDirective << " "
+ << this->Convert(progressFileNameFull.c_str(),
+ cmLocalGenerator::START_OUTPUT,
+ cmLocalGenerator::MAKEFILE) << "\n\n";
+ }
// Write all global targets
this->WriteDivider(ruleFileStream);
ruleFileStream
@@ -1477,15 +1480,18 @@
std::string progressDir = this->Makefile->GetHomeOutputDirectory();
progressDir += cmake::GetCMakeFilesDirectory();
+ if(this->ProgressCount)
{
- cmOStringStream progCmd;
- progCmd <<
- "$(CMAKE_COMMAND) -E cmake_progress_start ";
- progCmd << this->Convert(progressDir.c_str(),
- cmLocalGenerator::FULL,
- cmLocalGenerator::SHELL);
- progCmd << " $(CMAKE_ALL_PROGRESS)";
- commands.push_back(progCmd.str());
+ {
+ cmOStringStream progCmd;
+ progCmd <<
+ "$(CMAKE_COMMAND) -E cmake_progress_start ";
+ progCmd << this->Convert(progressDir.c_str(),
+ cmLocalGenerator::FULL,
+ cmLocalGenerator::SHELL);
+ progCmd << " $(CMAKE_ALL_PROGRESS)";
+ commands.push_back(progCmd.str());
+ }
}
std::string mf2Dir = cmake::GetCMakeFilesDirectoryPostSlash();
mf2Dir += "Makefile2";
@@ -1494,6 +1500,7 @@
this->CreateCDCommand(commands,
this->Makefile->GetHomeOutputDirectory(),
this->Makefile->GetStartOutputDirectory());
+ if(this->ProgressCount)
{
cmOStringStream progCmd;
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0
diff -ruN cmake-2.4.6-original/Source/cmLocalUnixMakefileGenerator3.h cmake-2.4.6-patched/Source/cmLocalUnixMakefileGenerator3.h
--- cmake-2.4.6-original/Source/cmLocalUnixMakefileGenerator3.h 2007-07-11 06:20:09.000006000 +0200
+++ cmake-2.4.6-patched/Source/cmLocalUnixMakefileGenerator3.h 2007-07-11 07:07:20.000020000 +0200
@@ -358,6 +358,10 @@
/* Copy the setting of CMAKE_COLOR_MAKEFILE from the makefile at the
beginning of generation to avoid many duplicate lookups. */
bool ColorMakefile;
+
+ /* Copy the setting of CMAKE_PROGRESS_COUNT from the makefile at the
+ beginning of generation to avoid many duplicate lookups. */
+ bool ProgressCount;
/* Copy the setting of CMAKE_SKIP_PREPROCESSED_SOURCE_RULES and
CMAKE_SKIP_ASSEMBLY_SOURCE_RULES at the beginning of generation to
diff -ruN cmake-2.4.6-original/Source/cmMakefileTargetGenerator.cxx cmake-2.4.6-patched/Source/cmMakefileTargetGenerator.cxx
--- cmake-2.4.6-original/Source/cmMakefileTargetGenerator.cxx 2007-07-10 21:45:48.000025000 +0200
+++ cmake-2.4.6-patched/Source/cmMakefileTargetGenerator.cxx 2007-07-11 07:06:56.000011000 +0200
@@ -428,20 +428,22 @@
std::vector<std::string> no_commands;
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());
-
+ if(this->Makefile->IsOn("CMAKE_PROGRESS_COUNT"))
+ {
+ // 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());
+ }
std::string buildEcho = "Building ";
buildEcho += lang;
buildEcho += " object ";
@@ -838,7 +840,8 @@
// Collect the commands.
std::vector<std::string> commands;
std::string comment = this->LocalGenerator->ConstructComment(cc);
- if(!comment.empty())
+ if(!comment.empty() &&
+ this->Makefile->IsOn("CMAKE_PROGRESS_COUNT"))
{
// add in a progress call if needed
std::string progressDir = this->Makefile->GetHomeOutputDirectory();
|