[Cmake-commits] CMake branch, next, updated. v3.2.2-3066-gd2a981a

Stephen Kelly steveire at gmail.com
Thu May 21 19:30:16 EDT 2015


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  d2a981afa7e038dfb44e2643e263f089bfd12541 (commit)
       via  8b4b9631f5f79ffee11b33c1e8826cd4064b3a23 (commit)
       via  46656aa1fa69b79aa0c645a131d7abfdc34e621c (commit)
       via  55fc5e7c9ad018bbb90fbcee6ac09cf224b46246 (commit)
       via  ca7cc2ebd0bd17b70279a51a3a087b5629175f06 (commit)
       via  fa752bf3393e583851b333cc41d2507dc217e9a8 (commit)
      from  75e071117161e8e01a5fd3144279f276dcf8f1a1 (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=d2a981afa7e038dfb44e2643e263f089bfd12541
commit d2a981afa7e038dfb44e2643e263f089bfd12541
Merge: 75e0711 8b4b963
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu May 21 19:30:14 2015 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu May 21 19:30:14 2015 -0400

    Merge topic 'clean-up-backtrace-handling' into next
    
    8b4b9631 cmake: Add IssueMessage overload taking a single cmListFileContext.
    46656aa1 cmake: Extract displayMessage method.
    55fc5e7c cmake: Extract printMessageText method.
    ca7cc2eb cmake: Extract PrintMessagePreamble method.
    fa752bf3 cmake: Move isError determination to a more-natural place.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8b4b9631f5f79ffee11b33c1e8826cd4064b3a23
commit 8b4b9631f5f79ffee11b33c1e8826cd4064b3a23
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 22 00:38:03 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri May 22 01:21:35 2015 +0200

    cmake: Add IssueMessage overload taking a single cmListFileContext.
    
    Port appropriate clients to use it.

diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index c816c23..bd098a5 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -14,6 +14,7 @@
 #include "cmSystemTools.h"
 #include "cmMakefile.h"
 #include "cmState.h"
+#include "cmLocalGenerator.h"
 
 #include "cmCommandArgumentLexer.h"
 
@@ -139,14 +140,14 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
                                      this->Makefile->GetHomeOutputDirectory()))
         {
         std::ostringstream msg;
-        cmListFileBacktrace bt(this->Makefile->GetLocalGenerator());
         cmListFileContext lfc;
-        lfc.FilePath = this->FileName;
+        lfc.FilePath = this->Makefile->GetLocalGenerator()
+            ->Convert(this->FileName, cmLocalGenerator::HOME);
+
         lfc.Line = this->FileLine;
-        bt.Append(lfc);
         msg << "uninitialized variable \'" << var << "\'";
         this->Makefile->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING,
-                                                        msg.str(), bt);
+                                                        msg.str(), lfc);
         }
       }
     return 0;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 2a49c8f..3e8ae85 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -249,19 +249,13 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
                               std::string const& text) const
 {
   // Collect context information.
-  cmLocalGenerator* localGen = this->GetLocalGenerator();
-  if(this->CallStack.empty() && this->GetCMakeInstance()->GetIsInTryCompile())
-    {
-    localGen = 0;
-    }
-  cmListFileBacktrace backtrace(localGen);
   if(!this->CallStack.empty())
     {
     if((t == cmake::FATAL_ERROR) || (t == cmake::INTERNAL_ERROR))
       {
       this->CallStack.back().Status->SetNestedError(true);
       }
-    backtrace = this->GetBacktrace();
+    this->GetCMakeInstance()->IssueMessage(t, text, this->GetBacktrace());
     }
   else
     {
@@ -278,12 +272,15 @@ void cmMakefile::IssueMessage(cmake::MessageType t,
       // command.  Add whatever context information we have.
       lfc.FilePath = this->ListFileStack.back();
       }
+    if(!this->CallStack.empty()
+       || !this->GetCMakeInstance()->GetIsInTryCompile())
+      {
+      lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath,
+                                                   cmLocalGenerator::HOME);
+      }
     lfc.Line = 0;
-    backtrace.Append(lfc);
+    this->GetCMakeInstance()->IssueMessage(t, text, lfc);
     }
-
-  // Issue the message.
-  this->GetCMakeInstance()->IssueMessage(t, text, backtrace);
 }
 
 //----------------------------------------------------------------------------
@@ -1837,22 +1834,22 @@ void cmMakefile::LogUnused(const char* reason,
   if (this->WarnUnused)
     {
     std::string path;
-    cmListFileBacktrace bt(this->GetLocalGenerator());
+    cmListFileContext lfc;
     if (!this->CallStack.empty())
       {
-      cmListFileContext file = this->GetExecutionContext();
-      bt.Append(file);
-      path = file.FilePath;
+      lfc = this->GetExecutionContext();
+      path = lfc.FilePath;
       }
     else
       {
       path = this->GetCurrentSourceDirectory();
       path += "/CMakeLists.txt";
-      cmListFileContext lfc;
       lfc.FilePath = path;
       lfc.Line = 0;
-      bt.Append(lfc);
       }
+    lfc.FilePath = this->LocalGenerator->Convert(lfc.FilePath,
+                                                 cmLocalGenerator::HOME);
+
     if (this->CheckSystemVars ||
         cmSystemTools::IsSubDirectory(path,
                                       this->GetHomeDirectory()) ||
@@ -1865,7 +1862,7 @@ void cmMakefile::LogUnused(const char* reason,
       msg << "unused variable (" << reason << ") \'" << name << "\'";
       this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING,
                                              msg.str(),
-                                             bt);
+                                             lfc);
       }
     }
 }
@@ -2769,14 +2766,13 @@ cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
                                              this->GetHomeOutputDirectory()))
                 {
                 std::ostringstream msg;
-                cmListFileBacktrace bt(this->GetLocalGenerator());
                 cmListFileContext lfc;
-                lfc.FilePath = filename;
+                lfc.FilePath = this->LocalGenerator
+                    ->Convert(filename, cmLocalGenerator::HOME);
                 lfc.Line = line;
-                bt.Append(lfc);
                 msg << "uninitialized variable \'" << lookup << "\'";
                 this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING,
-                                                       msg.str(), bt);
+                                                       msg.str(), lfc);
                 }
               }
             }
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 15ea755..38a67cd 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2553,6 +2553,24 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
 }
 
 //----------------------------------------------------------------------------
+void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
+                         cmListFileContext const& lfc)
+{
+  std::ostringstream msg;
+  if (!this->PrintMessagePreamble(t, msg))
+    {
+    return;
+    }
+
+  // Add the immediate context.
+  msg << (lfc.Line ? " at " : " in ") << lfc;
+
+  printMessageText(msg, text);
+
+  displayMessage(t, msg);
+}
+
+//----------------------------------------------------------------------------
 std::vector<std::string> cmake::GetDebugConfigs()
 {
   std::vector<std::string> configs;
diff --git a/Source/cmake.h b/Source/cmake.h
index d83c6fc..7f95fb6 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -303,6 +303,9 @@ class cmake
   /** Display a message to the user.  */
   void IssueMessage(cmake::MessageType t, std::string const& text,
         cmListFileBacktrace const& backtrace = cmListFileBacktrace(NULL));
+  void IssueMessage(cmake::MessageType t, std::string const& text,
+        cmListFileContext const& lfc);
+
   ///! run the --build option
   int Build(const std::string& dir,
             const std::string& target,

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=46656aa1fa69b79aa0c645a131d7abfdc34e621c
commit 46656aa1fa69b79aa0c645a131d7abfdc34e621c
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 22 00:35:21 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri May 22 00:54:28 2015 +0200

    cmake: Extract displayMessage method.

diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 565db8b..15ea755 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2485,26 +2485,8 @@ void printMessageText(std::ostream& msg, std::string const& text)
    formatter.PrintFormatted(msg, text.c_str());
 }
 
-//----------------------------------------------------------------------------
-void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
-                         cmListFileBacktrace const& bt)
+void displayMessage(cmake::MessageType t, std::ostringstream& msg)
 {
-  cmListFileBacktrace backtrace = bt;
-  backtrace.MakeRelative();
-
-  std::ostringstream msg;
-  if (!this->PrintMessagePreamble(t, msg))
-    {
-    return;
-    }
-
-  // Add the immediate context.
-  backtrace.PrintTitle(msg);
-
-  printMessageText(msg, text);
-
-  // Add the rest of the context.
-  backtrace.PrintCallStack(msg);
 
   // Add a note about warning suppression.
   if(t == cmake::AUTHOR_WARNING)
@@ -2547,6 +2529,30 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
 }
 
 //----------------------------------------------------------------------------
+void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
+                         cmListFileBacktrace const& bt)
+{
+  cmListFileBacktrace backtrace = bt;
+  backtrace.MakeRelative();
+
+  std::ostringstream msg;
+  if (!this->PrintMessagePreamble(t, msg))
+    {
+    return;
+    }
+
+  // Add the immediate context.
+  backtrace.PrintTitle(msg);
+
+  printMessageText(msg, text);
+
+  // Add the rest of the context.
+  backtrace.PrintCallStack(msg);
+
+  displayMessage(t, msg);
+}
+
+//----------------------------------------------------------------------------
 std::vector<std::string> cmake::GetDebugConfigs()
 {
   std::vector<std::string> configs;

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=55fc5e7c9ad018bbb90fbcee6ac09cf224b46246
commit 55fc5e7c9ad018bbb90fbcee6ac09cf224b46246
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 22 00:33:45 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri May 22 00:54:27 2015 +0200

    cmake: Extract printMessageText method.

diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 29f84df..565db8b 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2477,6 +2477,14 @@ bool cmake::PrintMessagePreamble(cmake::MessageType t, std::ostream& msg)
   return true;
 }
 
+void printMessageText(std::ostream& msg, std::string const& text)
+{
+   msg << ":\n";
+   cmDocumentationFormatter formatter;
+   formatter.SetIndent("  ");
+   formatter.PrintFormatted(msg, text.c_str());
+}
+
 //----------------------------------------------------------------------------
 void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
                          cmListFileBacktrace const& bt)
@@ -2493,13 +2501,7 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
   // Add the immediate context.
   backtrace.PrintTitle(msg);
 
-  // Add the message text.
-  {
-  msg << ":\n";
-  cmDocumentationFormatter formatter;
-  formatter.SetIndent("  ");
-  formatter.PrintFormatted(msg, text.c_str());
-  }
+  printMessageText(msg, text);
 
   // Add the rest of the context.
   backtrace.PrintCallStack(msg);

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca7cc2ebd0bd17b70279a51a3a087b5629175f06
commit ca7cc2ebd0bd17b70279a51a3a087b5629175f06
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 22 00:31:52 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri May 22 00:54:26 2015 +0200

    cmake: Extract PrintMessagePreamble method.

diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index fe727cd..29f84df 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2436,14 +2436,8 @@ static bool cmakeCheckStampList(const char* stampList)
   return true;
 }
 
-//----------------------------------------------------------------------------
-void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
-                         cmListFileBacktrace const& bt)
+bool cmake::PrintMessagePreamble(cmake::MessageType t, std::ostream& msg)
 {
-  cmListFileBacktrace backtrace = bt;
-  backtrace.MakeRelative();
-
-  std::ostringstream msg;
   // Construct the message header.
   if(t == cmake::FATAL_ERROR)
     {
@@ -2475,11 +2469,26 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
                                         "CMAKE_SUPPRESS_DEVELOPER_WARNINGS");
       if(suppress && cmSystemTools::IsOn(suppress))
         {
-        return;
+        return false;
         }
       msg << " (dev)";
       }
     }
+  return true;
+}
+
+//----------------------------------------------------------------------------
+void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
+                         cmListFileBacktrace const& bt)
+{
+  cmListFileBacktrace backtrace = bt;
+  backtrace.MakeRelative();
+
+  std::ostringstream msg;
+  if (!this->PrintMessagePreamble(t, msg))
+    {
+    return;
+    }
 
   // Add the immediate context.
   backtrace.PrintTitle(msg);
diff --git a/Source/cmake.h b/Source/cmake.h
index 0a1ee7d..d83c6fc 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -399,6 +399,8 @@ private:
 
   // Print a list of valid generators to stderr.
   void PrintGeneratorList();
+
+  bool PrintMessagePreamble(cmake::MessageType t, std::ostream& msg);
 };
 
 #define CMAKE_STANDARD_OPTIONS_TABLE \

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fa752bf3393e583851b333cc41d2507dc217e9a8
commit fa752bf3393e583851b333cc41d2507dc217e9a8
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Fri May 22 00:28:19 2015 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Fri May 22 00:54:26 2015 +0200

    cmake: Move isError determination to a more-natural place.

diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index ebec923..fe727cd 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2444,16 +2444,13 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
   backtrace.MakeRelative();
 
   std::ostringstream msg;
-  bool isError = false;
   // Construct the message header.
   if(t == cmake::FATAL_ERROR)
     {
-    isError = true;
     msg << "CMake Error";
     }
   else if(t == cmake::INTERNAL_ERROR)
     {
-    isError = true;
     msg << "CMake Internal Error (please report a bug)";
     }
   else if(t == cmake::LOG)
@@ -2463,7 +2460,6 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
   else if(t == cmake::DEPRECATION_ERROR)
     {
     msg << "CMake Deprecation Error";
-    isError = true;
     }
   else if (t == cmake::DEPRECATION_WARNING)
     {
@@ -2526,7 +2522,9 @@ void cmake::IssueMessage(cmake::MessageType t, std::string const& text,
 #endif
 
   // Output the message.
-  if(isError)
+  if(t == cmake::FATAL_ERROR
+     || t == cmake::INTERNAL_ERROR
+     || t == cmake::DEPRECATION_ERROR)
     {
     cmSystemTools::SetErrorOccured();
     cmSystemTools::Message(msg.str().c_str(), "Error");

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

Summary of changes:
 Source/cmCommandArgumentParserHelper.cxx |    9 ++--
 Source/cmMakefile.cxx                    |   40 +++++++-------
 Source/cmake.cxx                         |   83 +++++++++++++++++++++---------
 Source/cmake.h                           |    5 ++
 4 files changed, 86 insertions(+), 51 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list