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  37487c1f29dd8f2d924711708b0bd28cd5e7f26d (commit)
       via  b3b095a933d7f355fcdd57c041c771b7618c9717 (commit)
      from  d4f1f23850e95607f1b18bb3cd11079fb6c8df5f (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=37487c1f29dd8f2d924711708b0bd28cd5e7f26d
commit 37487c1f29dd8f2d924711708b0bd28cd5e7f26d
Merge: d4f1f23 b3b095a
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Wed May 16 09:19:03 2012 -0400
Commit:     CMake Topic Stage <kwro...@kitware.com>
CommitDate: Wed May 16 09:19:03 2012 -0400

    Merge topic 'cmake-trace-elseif' into next
    
    b3b095a Print any evaluated 'elseif'/'else' commands in trace mode (#13220)


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b3b095a933d7f355fcdd57c041c771b7618c9717
commit b3b095a933d7f355fcdd57c041c771b7618c9717
Author:     Brian Helba <brian.he...@kitware.com>
AuthorDate: Mon May 14 18:50:30 2012 -0400
Commit:     Brad King <brad.k...@kitware.com>
CommitDate: Wed May 16 09:07:55 2012 -0400

    Print any evaluated 'elseif'/'else' commands in trace mode (#13220)
    
    In trace mode ('--trace'), any 'elseif' or 'else' commands that are
    evaluated as part of a conditional block will be printed.  Previously,
    only the opening 'if' command of a conditional block was printed.

diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index 4eed477..ffc0f35 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -74,6 +74,13 @@ IsFunctionBlocked(const cmListFileFunction& lff,
           {
           this->IsBlocking = this->HasRun;
           this->HasRun = true;
+
+          // if trace is enabled, print a (trivially) evaluated "else"
+          // statement
+          if(!this->IsBlocking && mf.GetCMakeInstance()->GetTrace())
+            {
+            mf.PrintCommandTrace(this->Functions[c]);
+            }
           }
         else if (scopeDepth == 0 && !cmSystemTools::Strucmp
                  (this->Functions[c].Name.c_str(),"elseif"))
@@ -88,6 +95,12 @@ IsFunctionBlocked(const cmListFileFunction& lff,
             cmMakefileCall stack_manager(&mf, this->Functions[c], status);
             static_cast<void>(stack_manager);
 
+            // if trace is enabled, print the evaluated "elseif" statement
+            if(mf.GetCMakeInstance()->GetTrace())
+              {
+              mf.PrintCommandTrace(this->Functions[c]);
+              }
+
             std::string errorString;
 
             std::vector<std::string> expandedArguments;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0a709ae..a60896f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -354,6 +354,22 @@ bool cmMakefile::GetBacktrace(cmListFileBacktrace& 
backtrace) const
 }
 
 //----------------------------------------------------------------------------
+void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff)
+{
+  cmOStringStream msg;
+  msg << lff.FilePath << "(" << lff.Line << "):  ";
+  msg << lff.Name << "(";
+  for(std::vector<cmListFileArgument>::const_iterator i =
+        lff.Arguments.begin(); i != lff.Arguments.end(); ++i)
+    {
+    msg << i->Value;
+    msg << " ";
+    }
+  msg << ")";
+  cmSystemTools::Message(msg.str().c_str());
+}
+
+//----------------------------------------------------------------------------
 bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
                                 cmExecutionStatus &status)
 {
@@ -385,20 +401,10 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& 
lff,
        || pcmd->IsScriptable()))
 
       {
-      // if trace is one, print out invoke information
+      // if trace is enabled, print out invoke information
       if(this->GetCMakeInstance()->GetTrace())
         {
-        cmOStringStream msg;
-        msg << lff.FilePath << "(" << lff.Line << "):  ";
-        msg << lff.Name << "(";
-        for(std::vector<cmListFileArgument>::const_iterator i =
-              lff.Arguments.begin(); i != lff.Arguments.end(); ++i)
-          {
-          msg << i->Value;
-          msg << " ";
-          }
-        msg << ")";
-        cmSystemTools::Message(msg.str().c_str());
+        this->PrintCommandTrace(lff);
         }
       // Try invoking the command.
       if(!pcmd->InvokeInitialPass(lff.Arguments,status) ||
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 9fc64d6..8a0088b 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -701,6 +701,11 @@ public:
 #endif
 
   /**
+   * Print a command's invocation
+   */
+  void PrintCommandTrace(const cmListFileFunction& lff);
+
+  /**
    * Execute a single CMake command.  Returns true if the command
    * succeeded or false if it failed.
    */

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

Summary of changes:
 Source/cmIfCommand.cxx |   13 +++++++++++++
 Source/cmMakefile.cxx  |   30 ++++++++++++++++++------------
 Source/cmMakefile.h    |    5 +++++
 3 files changed, 36 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits

Reply via email to