Attached Files | make_progress.diff [^] (9,497 bytes) 2010-10-28 11:13 [Show Content] [Hide Content]diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 4e8e7e6..82cd434 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -25,6 +25,7 @@ cmGlobalUnixMakefileGenerator3::cmGlobalUnixMakefileGenerator3()
this->FindMakeProgramFile = "CMakeUnixFindMake.cmake";
this->ToolSupportsColor = true;
this->ForceVerboseMakefiles = false;
+ this->NoRuleMessages = false;
#if defined(_WIN32) || defined(__VMS)
this->UseLinkScript = false;
@@ -144,39 +145,48 @@ void cmGlobalUnixMakefileGenerator3::Generate()
// first do superclass method
this->cmGlobalGenerator::Generate();
- // initialize progress
- unsigned long total = 0;
- for(ProgressMapType::const_iterator pmi = this->ProgressMap.begin();
- pmi != this->ProgressMap.end(); ++pmi)
+ cmake* cm = this->GetCMakeInstance();
+ if(const char* ruleStatus = cm->GetProperty("RULE_MESSAGES"))
{
- total += pmi->second.NumberOfActions;
+ this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus);
}
-
- // write each target's progress.make this loop is done twice. Bascially the
- // Generate pass counts all the actions, the first loop below determines
- // how many actions have progress updates for each target and writes to
- // corrrect variable values for everything except the all targets. The
- // second loop actually writes out correct values for the all targets as
- // well. This is because the all targets require more information that is
- // computed in the first loop.
- unsigned long current = 0;
- for(ProgressMapType::iterator pmi = this->ProgressMap.begin();
- pmi != this->ProgressMap.end(); ++pmi)
- {
- pmi->second.WriteProgressVariables(total, current);
- }
- for(unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
+
+ if(!this->NoRuleMessages)
{
- cmLocalUnixMakefileGenerator3 *lg =
- static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
- std::string markFileName = lg->GetMakefile()->GetStartOutputDirectory();
- markFileName += "/";
- markFileName += cmake::GetCMakeFilesDirectory();
- markFileName += "/progress.marks";
- cmGeneratedFileStream markFile(markFileName.c_str());
- markFile << this->CountProgressMarksInAll(lg) << "\n";
+ // initialize progress
+ unsigned long total = 0;
+ for(ProgressMapType::const_iterator pmi = this->ProgressMap.begin();
+ pmi != this->ProgressMap.end(); ++pmi)
+ {
+ total += pmi->second.NumberOfActions;
+ }
+
+ // write each target's progress.make this loop is done twice. Bascially the
+ // Generate pass counts all the actions, the first loop below determines
+ // how many actions have progress updates for each target and writes to
+ // corrrect variable values for everything except the all targets. The
+ // second loop actually writes out correct values for the all targets as
+ // well. This is because the all targets require more information that is
+ // computed in the first loop.
+ unsigned long current = 0;
+ for(ProgressMapType::iterator pmi = this->ProgressMap.begin();
+ pmi != this->ProgressMap.end(); ++pmi)
+ {
+ pmi->second.WriteProgressVariables(total, current);
+ }
+ for(unsigned int i = 0; i < this->LocalGenerators.size(); ++i)
+ {
+ cmLocalUnixMakefileGenerator3 *lg =
+ static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
+ std::string markFileName = lg->GetMakefile()->GetStartOutputDirectory();
+ markFileName += "/";
+ markFileName += cmake::GetCMakeFilesDirectory();
+ markFileName += "/progress.marks";
+ cmGeneratedFileStream markFile(markFileName.c_str());
+ markFile << this->CountProgressMarksInAll(lg) << "\n";
+ }
}
-
+
// write the main makefile
this->WriteMainMakefile2();
this->WriteMainCMakefile();
@@ -738,31 +748,35 @@ cmGlobalUnixMakefileGenerator3
// Write the rule.
localName += "/all";
depends.clear();
+ std::string progressDir;
- std::string progressDir =
- lg->GetMakefile()->GetHomeOutputDirectory();
- progressDir += cmake::GetCMakeFilesDirectory();
+ if(!this->NoRuleMessages)
{
- cmOStringStream progCmd;
- progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
- // all target counts
- progCmd << lg->Convert(progressDir.c_str(),
- cmLocalGenerator::FULL,
- cmLocalGenerator::SHELL);
- progCmd << " ";
- std::vector<unsigned long>& progFiles =
- this->ProgressMap[&t->second].Marks;
- for (std::vector<unsigned long>::iterator i = progFiles.begin();
- i != progFiles.end(); ++i)
+ progressDir =
+ lg->GetMakefile()->GetHomeOutputDirectory();
+ progressDir += cmake::GetCMakeFilesDirectory();
{
- progCmd << " " << *i;
+ cmOStringStream progCmd;
+ progCmd << "$(CMAKE_COMMAND) -E cmake_progress_report ";
+ // all target counts
+ progCmd << lg->Convert(progressDir.c_str(),
+ cmLocalGenerator::FULL,
+ cmLocalGenerator::SHELL);
+ progCmd << " ";
+ std::vector<unsigned long>& progFiles =
+ this->ProgressMap[&t->second].Marks;
+ for (std::vector<unsigned long>::iterator i = progFiles.begin();
+ i != progFiles.end(); ++i)
+ {
+ progCmd << " " << *i;
+ }
+ commands.push_back(progCmd.str());
}
- commands.push_back(progCmd.str());
+ progressDir = "Built target ";
+ progressDir += t->first;
+ lg->AppendEcho(commands,progressDir.c_str());
}
- 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);
@@ -776,39 +790,43 @@ cmGlobalUnixMakefileGenerator3
lg->WriteMakeRule(ruleFileStream, "Include target in all.",
"all", depends, commands, true);
}
-
- // Write the rule.
- commands.clear();
- progressDir = lg->GetMakefile()->GetHomeOutputDirectory();
- progressDir += cmake::GetCMakeFilesDirectory();
-
- {
- // TODO: Convert the total progress count to a make variable.
- cmOStringStream progCmd;
- progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start ";
- // # in target
- progCmd << lg->Convert(progressDir.c_str(),
- cmLocalGenerator::FULL,
- cmLocalGenerator::SHELL);
- //
- std::set<cmTarget *> emitted;
- progCmd << " "
- << this->CountProgressMarksInTarget(&t->second, emitted);
- commands.push_back(progCmd.str());
- }
+
+ if(!this->NoRuleMessages)
+ {
+ // Write the rule.
+ commands.clear();
+ progressDir = lg->GetMakefile()->GetHomeOutputDirectory();
+ progressDir += cmake::GetCMakeFilesDirectory();
+
+ {
+ // TODO: Convert the total progress count to a make variable.
+ cmOStringStream progCmd;
+ progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start ";
+ // # in target
+ progCmd << lg->Convert(progressDir.c_str(),
+ cmLocalGenerator::FULL,
+ cmLocalGenerator::SHELL);
+ //
+ std::set<cmTarget *> emitted;
+ progCmd << " "
+ << this->CountProgressMarksInTarget(&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()));
- {
- 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());
- }
+ if(!this->NoRuleMessages)
+ {
+ 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");
localName = lg->GetRelativeTargetDirectory(t->second);
diff --git a/Source/cmGlobalUnixMakefileGenerator3.h b/Source/cmGlobalUnixMakefileGenerator3.h
index f499536..01f5fac 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.h
+++ b/Source/cmGlobalUnixMakefileGenerator3.h
@@ -170,6 +170,7 @@ protected:
std::string EmptyRuleHackCommand;
bool ForceVerboseMakefiles;
+ bool NoRuleMessages;
// Store per-target progress counters.
struct TargetProgress
0009-Honor-RULE_MESSAGES-property-properly.patch [^] (2,577 bytes) 2011-06-16 14:52 [Show Content] [Hide Content]From 305769e795b2f6ad6f926367ef007fde11ba133a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= <jerome.gardou@laposte.net>
Date: Wed, 15 Jun 2011 21:10:55 +0200
Subject: [PATCH 9/9] Honor RULE_MESSAGES property properly
---
Source/cmGlobalGenerator.cxx | 9 +++++++++
Source/cmGlobalGenerator.h | 4 ++++
Source/cmLocalUnixMakefileGenerator3.cxx | 2 ++
3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a7ab922..4b066ca 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -54,6 +54,9 @@ cmGlobalGenerator::cmGlobalGenerator()
// how long to let try compiles run
this->TryCompileTimeout = 0;
+ // Should we output rule messages
+ this->NoRuleMessages = false;
+
this->ExtraGenerator = 0;
this->CurrentLocalGenerator = 0;
this->TryCompileOuterMakefile = 0;
@@ -1596,6 +1599,12 @@ void cmGlobalGenerator::SetCMakeInstance(cmake* cm)
{
// Store a pointer to the cmake object instance.
this->CMakeInstance = cm;
+
+ // Set some properties inherited from global scope
+ if(const char* ruleStatus = cm->GetProperty("RULE_MESSAGES"))
+ {
+ this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus);
+ }
}
void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index df59a2c..002067a 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -263,6 +263,8 @@ public:
i.e. "Can I build Debug and Release in the same tree?" */
virtual bool IsMultiConfig() { return false; }
+ bool GetNoRuleMessages() { return this->NoRuleMessages; }
+
protected:
typedef std::vector<cmLocalGenerator*> GeneratorVector;
// for a project collect all its targets by following depend
@@ -282,6 +284,8 @@ protected:
bool CheckTargets();
+ bool NoRuleMessages;
+
// Fill the ProjectMap, this must be called after LocalGenerators
// has been populated.
void FillProjectMap();
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index a7844ae..ffd67b8 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1739,6 +1739,8 @@ void cmLocalUnixMakefileGenerator3
std::string progressDir = this->Makefile->GetHomeOutputDirectory();
progressDir += cmake::GetCMakeFilesDirectory();
+
+ if(!(this->GlobalGenerator->GetNoRuleMessages()))
{
cmOStringStream progCmd;
progCmd <<
--
1.7.3.1.msysgit.0
0009-Honor-RULE_MESSAGES-property-properly-2.diff [^] (2,676 bytes) 2011-06-17 12:54 [Show Content] [Hide Content]From 305769e795b2f6ad6f926367ef007fde11ba133a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= <jerome.gardou@laposte.net>
Date: Wed, 15 Jun 2011 21:10:55 +0200
Subject: [PATCH 9/9] Honor RULE_MESSAGES property properly
---
Source/cmGlobalGenerator.cxx | 9 +++++++++
Source/cmGlobalGenerator.h | 4 ++++
Source/cmLocalUnixMakefileGenerator3.cxx | 2 ++
3 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index a7ab922..4b066ca 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -54,6 +54,9 @@ cmGlobalGenerator::cmGlobalGenerator()
// how long to let try compiles run
this->TryCompileTimeout = 0;
+ // Should we output rule messages
+ this->NoRuleMessages = false;
+
this->ExtraGenerator = 0;
this->CurrentLocalGenerator = 0;
this->TryCompileOuterMakefile = 0;
@@ -1596,6 +1599,12 @@ void cmGlobalGenerator::SetCMakeInstance(cmake* cm)
{
// Store a pointer to the cmake object instance.
this->CMakeInstance = cm;
+
+ // Set some properties inherited from global scope
+ if(const char* ruleStatus = cm->GetProperty("RULE_MESSAGES"))
+ {
+ this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus);
+ }
}
void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index df59a2c..002067a 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -263,6 +263,8 @@ public:
i.e. "Can I build Debug and Release in the same tree?" */
virtual bool IsMultiConfig() { return false; }
+ bool GetNoRuleMessages() { return this->NoRuleMessages; }
+
protected:
typedef std::vector<cmLocalGenerator*> GeneratorVector;
// for a project collect all its targets by following depend
@@ -282,6 +284,8 @@ protected:
bool CheckTargets();
+ bool NoRuleMessages;
+
// Fill the ProjectMap, this must be called after LocalGenerators
// has been populated.
void FillProjectMap();
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index a7844ae..ffd67b8 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1739,6 +1739,8 @@ void cmLocalUnixMakefileGenerator3
std::string progressDir = this->Makefile->GetHomeOutputDirectory();
progressDir += cmake::GetCMakeFilesDirectory();
+
+ if(!(this->GlobalGenerator->GetNoRuleMessages()))
{
cmOStringStream progCmd;
progCmd <<
--
1.7.3.1.msysgit.0
0001-ndle-RULE_MESSAGES-property-next-try.patch [^] (3,036 bytes) 2011-06-17 13:59 [Show Content] [Hide Content]From 83eb047f007fdb54ebce8ba70c888a0e6cb77bbf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= <jerome.gardou@laposte.net>
Date: Fri, 17 Jun 2011 19:50:56 +0200
Subject: ndle RULE_MESSAGES property, next try
---
Source/cmGlobalGenerator.cxx | 43 +++++++----
Source/cmGlobalGenerator.h | 28 ++++---
Source/cmLocalUnixMakefileGenerator3.cxx | 120 +++++++++++++++--------------
3 files changed, 104 insertions(+), 87 deletions(-)
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 6c8938e..6c10866 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -54,6 +54,9 @@ cmGlobalGenerator::cmGlobalGenerator()
// how long to let try compiles run
this->TryCompileTimeout = 0;
+ // Should we output rule messages
+ this->NoRuleMessages = false;
+
this->ExtraGenerator = 0;
this->CurrentLocalGenerator = 0;
this->TryCompileOuterMakefile = 0;)
@@ -1596,6 +1599,12 @@ void cmGlobalGenerator::SetCMakeInstance(cmake* cm)
{
// Store a pointer to the cmake object instance.
this->CMakeInstance = cm;
+
+ // Set some properties inherited from global scope
+ if(const char* ruleStatus = cm->GetProperty("RULE_MESSAGES"))
+ {
+ this->NoRuleMessages = cmSystemTools::IsOff(ruleStatus);
+ }
}
void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 5268731..7164824 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -263,6 +263,8 @@ public:
i.e. "Can I build Debug and Release in the same tree?" */
virtual bool IsMultiConfig() { return false; }
+ bool GetNoRuleMessages() { return this->NoRuleMessages; }
+
protected:
typedef std::vector<cmLocalGenerator*> GeneratorVector;
// for a project collect all its targets by following depend
@@ -282,6 +284,8 @@ protected:
bool CheckTargets();
+ bool NoRuleMessages;
+
// Fill the ProjectMap, this must be called after LocalGenerators
// has been populated.
void FillProjectMap();
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 5c2cda1..6b194ad 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1739,6 +1739,8 @@ void cmLocalUnixMakefileGenerator3
std::string progressDir = this->Makefile->GetHomeOutputDirectory();
progressDir += cmake::GetCMakeFilesDirectory();
+
+ if(!(this->GlobalGenerator->GetNoRuleMessages()))
{
cmOStringStream progCmd;
progCmd <<
@@ -1763,6 +1765,8 @@ void cmLocalUnixMakefileGenerator3
this->CreateCDCommand(commands,
this->Makefile->GetHomeOutputDirectory(),
cmLocalGenerator::START_OUTPUT);
+
+ if(!(this->GlobalGenerator->GetNoRuleMessages()))
{
cmOStringStream progCmd;
progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0
1.7.3.1.msysgit.0
|