[Cmake-commits] CMake branch, next, updated. v2.8.2-1150-g8c9bc9d

Brad King brad.king at kitware.com
Wed Nov 3 10:29:57 EDT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  8c9bc9d094d2777aa7d3a899834aa3317faf681c (commit)
       via  dc36b3499403bad323d7300139fbf459c31f7a2c (commit)
      from  97e7c6605b662ad59f463e30c6b6237fced99900 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8c9bc9d094d2777aa7d3a899834aa3317faf681c
commit 8c9bc9d094d2777aa7d3a899834aa3317faf681c
Merge: 97e7c66 dc36b34
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Nov 3 10:29:48 2010 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Nov 3 10:29:48 2010 -0400

    Merge topic 'rule-messages' into next
    
    dc36b34 Honor RULE_MESSAGES property for build target messages


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=dc36b3499403bad323d7300139fbf459c31f7a2c
commit dc36b3499403bad323d7300139fbf459c31f7a2c
Author:     Campbell Barton <ideasman42 at gmail.com>
AuthorDate: Thu Oct 28 11:13:00 2010 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Nov 3 10:10:03 2010 -0400

    Honor RULE_MESSAGES property for build target messages

diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 4e8e7e6..08eb391 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)
+  if(!this->NoRuleMessages)
     {
-    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";
+    // 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

-----------------------------------------------------------------------

Summary of changes:
 Source/cmGlobalUnixMakefileGenerator3.cxx |  172 ++++++++++++++++-------------
 Source/cmGlobalUnixMakefileGenerator3.h   |    1 +
 2 files changed, 96 insertions(+), 77 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list