[Cmake-commits] CMake branch, next, updated. v3.6.0-rc1-243-ga30ab87

Stephen Kelly steveire at gmail.com
Sun Jun 12 12:48:28 EDT 2016


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  a30ab870553df2fa8df99aaf1ba850cf664e384a (commit)
       via  3a467d7ee12fafd0373a977ebdbb580204d15ab9 (commit)
       via  4ba7c3978904cbeb9fd91041f223e16bffb4771e (commit)
       via  280b763a661d588b54a3be0363b27d21c8583a36 (commit)
       via  2f0b2d660ba137205b02303ebb1c72fcf694b2c4 (commit)
      from  a1064ff6ae876d4e239484f9cfe29701648e1e8f (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a30ab870553df2fa8df99aaf1ba850cf664e384a
commit a30ab870553df2fa8df99aaf1ba850cf664e384a
Merge: a1064ff 3a467d7
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sun Jun 12 12:48:27 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sun Jun 12 12:48:27 2016 -0400

    Merge topic 'clean-up-Parser' into next
    
    3a467d7e Parser: Out-of-line conditional code to cmMakefile
    4ba7c397 Parser: Issue file open error messages through dedicated API
    280b763a Parser: Issue messages through cmake, not cmSystemTools
    2f0b2d66 Parser: Store the Backtrace for use in issuing messages


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3a467d7ee12fafd0373a977ebdbb580204d15ab9
commit 3a467d7ee12fafd0373a977ebdbb580204d15ab9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jan 28 22:10:26 2016 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jun 12 18:39:39 2016 +0200

    Parser: Out-of-line conditional code to cmMakefile
    
    Simplify parser API.

diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index d514f9c..3811b02 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -128,7 +128,7 @@ bool cmListFileParser::ParseFile()
   return true;
 }
 
-bool cmListFile::ParseFile(const char* filename, bool topLevel, cmMakefile* mf)
+bool cmListFile::ParseFile(const char* filename, cmMakefile* mf)
 {
   if (!cmSystemTools::FileExists(filename) ||
       cmSystemTools::FileIsDirectory(filename)) {
@@ -142,76 +142,6 @@ bool cmListFile::ParseFile(const char* filename, bool topLevel, cmMakefile* mf)
     parseError = !parser.ParseFile();
   }
 
-  // do we need a cmake_policy(VERSION call?
-  if (topLevel) {
-    bool hasVersion = false;
-    // search for the right policy command
-    for (std::vector<cmListFileFunction>::iterator i = this->Functions.begin();
-         i != this->Functions.end(); ++i) {
-      if (cmSystemTools::LowerCase(i->Name) == "cmake_minimum_required") {
-        hasVersion = true;
-        break;
-      }
-    }
-    // if no policy command is found this is an error if they use any
-    // non advanced functions or a lot of functions
-    if (!hasVersion) {
-      bool isProblem = true;
-      if (this->Functions.size() < 30) {
-        // the list of simple commands DO NOT ADD TO THIS LIST!!!!!
-        // these commands must have backwards compatibility forever and
-        // and that is a lot longer than your tiny mind can comprehend mortal
-        std::set<std::string> allowedCommands;
-        allowedCommands.insert("project");
-        allowedCommands.insert("set");
-        allowedCommands.insert("if");
-        allowedCommands.insert("endif");
-        allowedCommands.insert("else");
-        allowedCommands.insert("elseif");
-        allowedCommands.insert("add_executable");
-        allowedCommands.insert("add_library");
-        allowedCommands.insert("target_link_libraries");
-        allowedCommands.insert("option");
-        allowedCommands.insert("message");
-        isProblem = false;
-        for (std::vector<cmListFileFunction>::iterator i =
-               this->Functions.begin();
-             i != this->Functions.end(); ++i) {
-          std::string name = cmSystemTools::LowerCase(i->Name);
-          if (allowedCommands.find(name) == allowedCommands.end()) {
-            isProblem = true;
-            break;
-          }
-        }
-      }
-
-      if (isProblem) {
-        // Tell the top level cmMakefile to diagnose
-        // this violation of CMP0000.
-        mf->SetCheckCMP0000(true);
-
-        // Implicitly set the version for the user.
-        mf->SetPolicyVersion("2.4");
-      }
-    }
-    bool hasProject = false;
-    // search for a project command
-    for (std::vector<cmListFileFunction>::iterator i = this->Functions.begin();
-         i != this->Functions.end(); ++i) {
-      if (cmSystemTools::LowerCase(i->Name) == "project") {
-        hasProject = true;
-        break;
-      }
-    }
-    // if no project command is found, add one
-    if (!hasProject) {
-      cmListFileFunction project;
-      project.Name = "PROJECT";
-      cmListFileArgument prj("Project", cmListFileArgument::Unquoted, 0);
-      project.Arguments.push_back(prj);
-      this->Functions.insert(this->Functions.begin(), project);
-    }
-  }
   return !parseError;
 }
 
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index d72c360..f3e6f70 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -158,7 +158,7 @@ private:
 
 struct cmListFile
 {
-  bool ParseFile(const char* path, bool topLevel, cmMakefile* mf);
+  bool ParseFile(const char* path, cmMakefile* mf);
 
   std::vector<cmListFileFunction> Functions;
 };
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ca30b3d..0a80347 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -426,7 +426,7 @@ bool cmMakefile::ReadDependentFile(const char* filename, bool noPolicyScope)
   IncludeScope incScope(this, filenametoread, noPolicyScope);
 
   cmListFile listFile;
-  if (!listFile.ParseFile(filenametoread.c_str(), false, this)) {
+  if (!listFile.ParseFile(filenametoread.c_str(), this)) {
     return false;
   }
 
@@ -475,7 +475,7 @@ bool cmMakefile::ReadListFile(const char* filename)
   ListFileScope scope(this, filenametoread);
 
   cmListFile listFile;
-  if (!listFile.ParseFile(filenametoread.c_str(), false, this)) {
+  if (!listFile.ParseFile(filenametoread.c_str(), this)) {
     return false;
   }
 
@@ -1420,10 +1420,81 @@ void cmMakefile::Configure()
   this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentStart.c_str());
 
   cmListFile listFile;
-  if (!listFile.ParseFile(currentStart.c_str(), this->IsRootMakefile(),
-                          this)) {
+  if (!listFile.ParseFile(currentStart.c_str(), this)) {
     return;
   }
+  if (this->IsRootMakefile()) {
+    bool hasVersion = false;
+    // search for the right policy command
+    for (std::vector<cmListFileFunction>::iterator i =
+           listFile.Functions.begin();
+         i != listFile.Functions.end(); ++i) {
+      if (cmSystemTools::LowerCase(i->Name) == "cmake_minimum_required") {
+        hasVersion = true;
+        break;
+      }
+    }
+    // if no policy command is found this is an error if they use any
+    // non advanced functions or a lot of functions
+    if (!hasVersion) {
+      bool isProblem = true;
+      if (listFile.Functions.size() < 30) {
+        // the list of simple commands DO NOT ADD TO THIS LIST!!!!!
+        // these commands must have backwards compatibility forever and
+        // and that is a lot longer than your tiny mind can comprehend mortal
+        std::set<std::string> allowedCommands;
+        allowedCommands.insert("project");
+        allowedCommands.insert("set");
+        allowedCommands.insert("if");
+        allowedCommands.insert("endif");
+        allowedCommands.insert("else");
+        allowedCommands.insert("elseif");
+        allowedCommands.insert("add_executable");
+        allowedCommands.insert("add_library");
+        allowedCommands.insert("target_link_libraries");
+        allowedCommands.insert("option");
+        allowedCommands.insert("message");
+        isProblem = false;
+        for (std::vector<cmListFileFunction>::iterator i =
+               listFile.Functions.begin();
+             i != listFile.Functions.end(); ++i) {
+          std::string name = cmSystemTools::LowerCase(i->Name);
+          if (allowedCommands.find(name) == allowedCommands.end()) {
+            isProblem = true;
+            break;
+          }
+        }
+      }
+
+      if (isProblem) {
+        // Tell the top level cmMakefile to diagnose
+        // this violation of CMP0000.
+        this->SetCheckCMP0000(true);
+
+        // Implicitly set the version for the user.
+        this->SetPolicyVersion("2.4");
+      }
+    }
+    bool hasProject = false;
+    // search for a project command
+    for (std::vector<cmListFileFunction>::iterator i =
+           listFile.Functions.begin();
+         i != listFile.Functions.end(); ++i) {
+      if (cmSystemTools::LowerCase(i->Name) == "project") {
+        hasProject = true;
+        break;
+      }
+    }
+    // if no project command is found, add one
+    if (!hasProject) {
+      cmListFileFunction project;
+      project.Name = "PROJECT";
+      cmListFileArgument prj("Project", cmListFileArgument::Unquoted, 0);
+      project.Arguments.push_back(prj);
+      listFile.Functions.insert(listFile.Functions.begin(), project);
+    }
+  }
+
   this->ReadListFile(listFile, currentStart);
   if (cmSystemTools::GetFatalErrorOccured()) {
     scope.Quiet();

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4ba7c3978904cbeb9fd91041f223e16bffb4771e
commit 4ba7c3978904cbeb9fd91041f223e16bffb4771e
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jun 9 09:58:15 2016 +0200
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jun 12 18:39:39 2016 +0200

    Parser: Issue file open error messages through dedicated API

diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 547b582..d514f9c 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -24,6 +24,7 @@ struct cmListFileParser
   cmListFileParser(cmListFile* lf, cmMakefile* mf, const char* filename);
   ~cmListFileParser();
   void IssueError(std::string const& text);
+  void IssueFileOpenError(std::string const& text) const;
   bool ParseFile();
   bool ParseFunction(const char* name, long line);
   bool AddArgument(cmListFileLexer_Token* token,
@@ -57,6 +58,12 @@ cmListFileParser::~cmListFileParser()
   cmListFileLexer_Delete(this->Lexer);
 }
 
+void cmListFileParser::IssueFileOpenError(const std::string& text) const
+{
+  this->Makefile->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, text,
+                                                   this->Backtrace);
+}
+
 void cmListFileParser::IssueError(const std::string& text)
 {
   cmListFileContext lfc;
@@ -73,16 +80,14 @@ bool cmListFileParser::ParseFile()
   // Open the file.
   cmListFileLexer_BOM bom;
   if (!cmListFileLexer_SetFileName(this->Lexer, this->FileName, &bom)) {
-    cmSystemTools::Error("cmListFileCache: error can not open file ",
-                         this->FileName);
+    this->IssueFileOpenError("cmListFileCache: error can not open file.");
     return false;
   }
 
   // Verify the Byte-Order-Mark, if any.
   if (bom != cmListFileLexer_BOM_None && bom != cmListFileLexer_BOM_UTF8) {
     cmListFileLexer_SetFileName(this->Lexer, 0, 0);
-    this->Makefile->IssueMessage(cmake::FATAL_ERROR,
-     "File starts with a Byte-Order-Mark that is not UTF-8.");
+    this->IssueFileOpenError("File starts with a Byte-Order-Mark that is not UTF-8.");
     return false;
   }
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=280b763a661d588b54a3be0363b27d21c8583a36
commit 280b763a661d588b54a3be0363b27d21c8583a36
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jan 28 22:10:23 2016 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jun 12 18:39:39 2016 +0200

    Parser: Issue messages through cmake, not cmSystemTools
    
    Make these messages uniform with regard to other messages issued by
    cmake.

diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 9ede8c6..547b582 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -23,6 +23,7 @@ struct cmListFileParser
 {
   cmListFileParser(cmListFile* lf, cmMakefile* mf, const char* filename);
   ~cmListFileParser();
+  void IssueError(std::string const& text);
   bool ParseFile();
   bool ParseFunction(const char* name, long line);
   bool AddArgument(cmListFileLexer_Token* token,
@@ -56,6 +57,17 @@ cmListFileParser::~cmListFileParser()
   cmListFileLexer_Delete(this->Lexer);
 }
 
+void cmListFileParser::IssueError(const std::string& text)
+{
+  cmListFileContext lfc;
+  lfc.FilePath = this->FileName;
+  lfc.Line = cmListFileLexer_GetCurrentLine(this->Lexer);
+  cmListFileBacktrace lfbt = this->Backtrace.Pop();
+  lfbt = lfbt.Push(lfc);
+  this->Makefile->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR, text,
+                                                   lfbt);
+}
+
 bool cmListFileParser::ParseFile()
 {
   // Open the file.
@@ -69,10 +81,8 @@ bool cmListFileParser::ParseFile()
   // Verify the Byte-Order-Mark, if any.
   if (bom != cmListFileLexer_BOM_None && bom != cmListFileLexer_BOM_UTF8) {
     cmListFileLexer_SetFileName(this->Lexer, 0, 0);
-    std::ostringstream m;
-    m << "File\n  " << this->FileName << "\n"
-      << "starts with a Byte-Order-Mark that is not UTF-8.";
-    this->Makefile->IssueMessage(cmake::FATAL_ERROR, m.str());
+    this->Makefile->IssueMessage(cmake::FATAL_ERROR,
+     "File starts with a Byte-Order-Mark that is not UTF-8.");
     return false;
   }
 
@@ -95,22 +105,18 @@ bool cmListFileParser::ParseFile()
         }
       } else {
         std::ostringstream error;
-        error << "Error in cmake code at\n"
-              << this->FileName << ":" << token->line << ":\n"
-              << "Parse error.  Expected a newline, got "
+        error << "Parse error.  Expected a newline, got "
               << cmListFileLexer_GetTypeAsString(this->Lexer, token->type)
               << " with text \"" << token->text << "\".";
-        cmSystemTools::Error(error.str().c_str());
+        this->IssueError(error.str());
         return false;
       }
     } else {
       std::ostringstream error;
-      error << "Error in cmake code at\n"
-            << this->FileName << ":" << token->line << ":\n"
-            << "Parse error.  Expected a command name, got "
+      error << "Parse error.  Expected a command name, got "
             << cmListFileLexer_GetTypeAsString(this->Lexer, token->type)
             << " with text \"" << token->text << "\".";
-      cmSystemTools::Error(error.str().c_str());
+      this->IssueError(error.str());
       return false;
     }
   }
@@ -223,18 +229,15 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
           << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n"
           << "Parse error.  Function missing opening \"(\".";
     /* clang-format on */
-    cmSystemTools::Error(error.str().c_str());
+    this->IssueError(error.str());
     return false;
   }
   if (token->type != cmListFileLexer_Token_ParenLeft) {
     std::ostringstream error;
-    error << "Error in cmake code at\n"
-          << this->FileName << ":"
-          << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n"
-          << "Parse error.  Expected \"(\", got "
+    error << "Parse error.  Expected \"(\", got "
           << cmListFileLexer_GetTypeAsString(this->Lexer, token->type)
           << " with text \"" << token->text << "\".";
-    cmSystemTools::Error(error.str().c_str());
+    this->IssueError(error.str());
     return false;
   }
 
@@ -286,25 +289,25 @@ bool cmListFileParser::ParseFunction(const char* name, long line)
     } else {
       // Error.
       std::ostringstream error;
-      error << "Error in cmake code at\n"
-            << this->FileName << ":"
-            << cmListFileLexer_GetCurrentLine(this->Lexer) << ":\n"
-            << "Parse error.  Function missing ending \")\".  "
+      error << "Parse error.  Function missing ending \")\".  "
             << "Instead found "
             << cmListFileLexer_GetTypeAsString(this->Lexer, token->type)
             << " with text \"" << token->text << "\".";
-      cmSystemTools::Error(error.str().c_str());
+      this->IssueError(error.str());
       return false;
     }
   }
 
   std::ostringstream error;
-  error << "Error in cmake code at\n"
-        << this->FileName << ":" << lastLine << ":\n"
-        << "Parse error.  Function missing ending \")\".  "
+  cmListFileContext lfc;
+  lfc.FilePath = this->FileName;
+  lfc.Line = lastLine;
+  cmListFileBacktrace lfbt = this->Backtrace.Pop();
+  lfbt = lfbt.Push(lfc);
+  error << "Parse error.  Function missing ending \")\".  "
         << "End of file reached.";
-  cmSystemTools::Error(error.str().c_str());
-
+  this->Makefile->GetCMakeInstance()->IssueMessage(cmake::FATAL_ERROR,
+                                                   error.str(), lfbt);
   return false;
 }
 
@@ -319,19 +322,18 @@ bool cmListFileParser::AddArgument(cmListFileLexer_Token* token,
   bool isError = (this->Separation == SeparationError ||
                   delim == cmListFileArgument::Bracket);
   std::ostringstream m;
-  /* clang-format off */
-  m << "Syntax " << (isError? "Error":"Warning") << " in cmake code at\n"
-    << "  " << this->FileName << ":" << token->line << ":"
-    << token->column << "\n"
+  cmListFileContext lfc;
+  lfc.FilePath = this->FileName;
+  lfc.Line = token->line;
+  cmListFileBacktrace lfbt = this->Backtrace.Pop();
+  lfbt = lfbt.Push(lfc);
+
+  m << "Syntax " << (isError ? "Error" : "Warning") << " in cmake code at "
+    << token->line << ":" << token->column << "\n"
     << "Argument not separated from preceding token by whitespace.";
-  /* clang-format on */
-  if (isError) {
-    this->Makefile->IssueMessage(cmake::FATAL_ERROR, m.str());
-    return false;
-  } else {
-    this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str());
-    return true;
-  }
+  this->Makefile->GetCMakeInstance()->IssueMessage(
+    isError ? cmake::FATAL_ERROR : cmake::AUTHOR_WARNING, m.str(), lfbt);
+  return !isError;
 }
 
 struct cmListFileBacktrace::Entry : public cmListFileContext
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt
index a845ffb..f0b6783 100644
--- a/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt
+++ b/Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt
@@ -1,8 +1,4 @@
 CMake Error in BOM-UTF-16-BE.cmake:
-  File
-
-    .*/Tests/RunCMake/Syntax/BOM-UTF-16-BE.cmake
-
-  starts with a Byte-Order-Mark that is not UTF-8.
+  File starts with a Byte-Order-Mark that is not UTF-8.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt
index cc4244b..bcc9c38 100644
--- a/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt
+++ b/Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt
@@ -1,8 +1,4 @@
 CMake Error in BOM-UTF-16-LE.cmake:
-  File
-
-    .*/Tests/RunCMake/Syntax/BOM-UTF-16-LE.cmake
-
-  starts with a Byte-Order-Mark that is not UTF-8.
+  File starts with a Byte-Order-Mark that is not UTF-8.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt
index 5f851bf..7bd74c9 100644
--- a/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt
+++ b/Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt
@@ -1,8 +1,4 @@
 CMake Error in BOM-UTF-32-BE.cmake:
-  File
-
-    .*/Tests/RunCMake/Syntax/BOM-UTF-32-BE.cmake
-
-  starts with a Byte-Order-Mark that is not UTF-8.
+  File starts with a Byte-Order-Mark that is not UTF-8.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt b/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt
index d8fafd0..678013f 100644
--- a/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt
+++ b/Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt
@@ -1,8 +1,4 @@
 CMake Error in BOM-UTF-32-LE.cmake:
-  File
-
-    .*/Tests/RunCMake/Syntax/BOM-UTF-32-LE.cmake
-
-  starts with a Byte-Order-Mark that is not UTF-8.
+  File starts with a Byte-Order-Mark that is not UTF-8.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BracketComment4-stderr.txt b/Tests/RunCMake/Syntax/BracketComment4-stderr.txt
index 8ba32c2..5ee4b18 100644
--- a/Tests/RunCMake/Syntax/BracketComment4-stderr.txt
+++ b/Tests/RunCMake/Syntax/BracketComment4-stderr.txt
@@ -1,7 +1,2 @@
-CMake Error: Error in cmake code at
-.*/Tests/RunCMake/Syntax/BracketComment4.cmake:3:
-Parse error.  Expected a newline, got identifier with text "message".
-CMake Error at CMakeLists.txt:3 \(include\):
-  include could not find load file:
-
-    BracketComment4.cmake
+CMake Error at BracketComment4.cmake:3:
+  Parse error.  Expected a newline, got identifier with text "message".
diff --git a/Tests/RunCMake/Syntax/BracketNoSpace0-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace0-stderr.txt
index a288280..836b4cb 100644
--- a/Tests/RunCMake/Syntax/BracketNoSpace0-stderr.txt
+++ b/Tests/RunCMake/Syntax/BracketNoSpace0-stderr.txt
@@ -1,8 +1,4 @@
-CMake Error in BracketNoSpace0.cmake:
-  Syntax Error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/BracketNoSpace0.cmake:1:27
+CMake Error at BracketNoSpace0.cmake:1:
+  Syntax Error in cmake code at 1:27
 
   Argument not separated from preceding token by whitespace.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BracketNoSpace1-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace1-stderr.txt
index 391e11b..904df72 100644
--- a/Tests/RunCMake/Syntax/BracketNoSpace1-stderr.txt
+++ b/Tests/RunCMake/Syntax/BracketNoSpace1-stderr.txt
@@ -1,8 +1,4 @@
-CMake Error in BracketNoSpace1.cmake:
-  Syntax Error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/BracketNoSpace1.cmake:1:24
+CMake Error at BracketNoSpace1.cmake:1:
+  Syntax Error in cmake code at 1:24
 
   Argument not separated from preceding token by whitespace.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BracketNoSpace2-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace2-stderr.txt
index acaf7fe..0357c16 100644
--- a/Tests/RunCMake/Syntax/BracketNoSpace2-stderr.txt
+++ b/Tests/RunCMake/Syntax/BracketNoSpace2-stderr.txt
@@ -1,8 +1,4 @@
-CMake Error in BracketNoSpace2.cmake:
-  Syntax Error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/BracketNoSpace2.cmake:1:44
+CMake Error at BracketNoSpace2.cmake:1:
+  Syntax Error in cmake code at 1:44
 
   Argument not separated from preceding token by whitespace.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BracketNoSpace3-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace3-stderr.txt
index f12b2e5..f70a052 100644
--- a/Tests/RunCMake/Syntax/BracketNoSpace3-stderr.txt
+++ b/Tests/RunCMake/Syntax/BracketNoSpace3-stderr.txt
@@ -1,8 +1,4 @@
-CMake Error in BracketNoSpace3.cmake:
-  Syntax Error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/BracketNoSpace3.cmake:1:45
+CMake Error at BracketNoSpace3.cmake:1:
+  Syntax Error in cmake code at 1:45
 
   Argument not separated from preceding token by whitespace.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BracketNoSpace4-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace4-stderr.txt
index 7157763..7dc7299 100644
--- a/Tests/RunCMake/Syntax/BracketNoSpace4-stderr.txt
+++ b/Tests/RunCMake/Syntax/BracketNoSpace4-stderr.txt
@@ -1,8 +1,4 @@
-CMake Error in BracketNoSpace4.cmake:
-  Syntax Error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/BracketNoSpace4.cmake:1:44
+CMake Error at BracketNoSpace4.cmake:1:
+  Syntax Error in cmake code at 1:44
 
   Argument not separated from preceding token by whitespace.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/BracketNoSpace5-stderr.txt b/Tests/RunCMake/Syntax/BracketNoSpace5-stderr.txt
index c13969d..59e431d 100644
--- a/Tests/RunCMake/Syntax/BracketNoSpace5-stderr.txt
+++ b/Tests/RunCMake/Syntax/BracketNoSpace5-stderr.txt
@@ -1,8 +1,4 @@
-CMake Error in BracketNoSpace5.cmake:
-  Syntax Error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/BracketNoSpace5.cmake:1:45
+CMake Error at BracketNoSpace5.cmake:1:
+  Syntax Error in cmake code at 1:45
 
   Argument not separated from preceding token by whitespace.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/CommandError0-stderr.txt b/Tests/RunCMake/Syntax/CommandError0-stderr.txt
index 24d7997..55c9ce0 100644
--- a/Tests/RunCMake/Syntax/CommandError0-stderr.txt
+++ b/Tests/RunCMake/Syntax/CommandError0-stderr.txt
@@ -1,8 +1,4 @@
-CMake Error: Error in cmake code at
-.*/Tests/RunCMake/Syntax/CommandError0.cmake:2:
-Parse error.  Expected "\(", got newline with text "
-".
-CMake Error at CMakeLists.txt:3 \(include\):
-  include could not find load file:
+CMake Error at CommandError0.cmake:2:
+  Parse error.  Expected "\(", got newline with text "
 
-    CommandError0.cmake
+  ".
diff --git a/Tests/RunCMake/Syntax/CommandError1-stderr.txt b/Tests/RunCMake/Syntax/CommandError1-stderr.txt
index 599f600..acf4505 100644
--- a/Tests/RunCMake/Syntax/CommandError1-stderr.txt
+++ b/Tests/RunCMake/Syntax/CommandError1-stderr.txt
@@ -1,7 +1,2 @@
-CMake Error: Error in cmake code at
-.*/Tests/RunCMake/Syntax/CommandError1.cmake:1:
-Parse error.  Expected a newline, got identifier with text "message".
-CMake Error at CMakeLists.txt:3 \(include\):
-  include could not find load file:
-
-    CommandError1.cmake
+CMake Error at CommandError1.cmake:1:
+  Parse error.  Expected a newline, got identifier with text "message".
diff --git a/Tests/RunCMake/Syntax/CommandError2-stderr.txt b/Tests/RunCMake/Syntax/CommandError2-stderr.txt
index f4dfc77..95c4ad1 100644
--- a/Tests/RunCMake/Syntax/CommandError2-stderr.txt
+++ b/Tests/RunCMake/Syntax/CommandError2-stderr.txt
@@ -1,7 +1,3 @@
-CMake Error: Error in cmake code at
-.*/Tests/RunCMake/Syntax/CommandError2.cmake:1:
-Parse error.  Expected a command name, got bracket argument with text "oops-not-a-comment".
-CMake Error at CMakeLists.txt:3 \(include\):
-  include could not find load file:
-
-    CommandError2.cmake
+CMake Error at CommandError2.cmake:1:
+  Parse error.  Expected a command name, got bracket argument with text
+  "oops-not-a-comment".
diff --git a/Tests/RunCMake/Syntax/ParenInENV-stderr.txt b/Tests/RunCMake/Syntax/ParenInENV-stderr.txt
index 37c5d6e..b9fb05a 100644
--- a/Tests/RunCMake/Syntax/ParenInENV-stderr.txt
+++ b/Tests/RunCMake/Syntax/ParenInENV-stderr.txt
@@ -1,7 +1,5 @@
-CMake Warning \(dev\) in ParenInENV.cmake:
-  Syntax Warning in cmake code at
-
-    .*/Tests/RunCMake/Syntax/ParenInENV.cmake:2:21
+CMake Warning \(dev\) at ParenInENV.cmake:2:
+  Syntax Warning in cmake code at 2:21
 
   Argument not separated from preceding token by whitespace.
 Call Stack \(most recent call first\):
@@ -11,7 +9,7 @@ This warning is for project developers.  Use -Wno-dev to suppress it.
 CMake Error at ParenInENV.cmake:2 \(message\):
   Syntax error in cmake code at
 
-    .*/Tests/RunCMake/Syntax/ParenInENV.cmake:2
+    .*Tests/RunCMake/Syntax/ParenInENV.cmake:2
 
   when parsing string
 
diff --git a/Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt b/Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt
index 45b2e6a..d8b56e9 100644
--- a/Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt
+++ b/Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt
@@ -1,28 +1,20 @@
-CMake Warning \(dev\) in ParenNoSpace1.cmake:
-  Syntax Warning in cmake code at
-
-    .*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:1:26
+CMake Warning \(dev\) at ParenNoSpace1.cmake:1:
+  Syntax Warning in cmake code at 1:26
 
   Argument not separated from preceding token by whitespace.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
 
-CMake Warning \(dev\) in ParenNoSpace1.cmake:
-  Syntax Warning in cmake code at
-
-    .*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:2:26
+CMake Warning \(dev\) at ParenNoSpace1.cmake:2:
+  Syntax Warning in cmake code at 2:26
 
   Argument not separated from preceding token by whitespace.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
 
-CMake Error in ParenNoSpace1.cmake:
-  Syntax Error in cmake code at
-
-    .*/Tests/RunCMake/Syntax/ParenNoSpace1.cmake:3:29
+CMake Error at ParenNoSpace1.cmake:3:
+  Syntax Error in cmake code at 3:29
 
   Argument not separated from preceding token by whitespace.
-Call Stack \(most recent call first\):
-  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt b/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt
index a4ec6e7..f21a8c6 100644
--- a/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt
+++ b/Tests/RunCMake/Syntax/StringNoSpace-stderr.txt
@@ -1,17 +1,13 @@
-CMake Warning \(dev\) in StringNoSpace.cmake:
-  Syntax Warning in cmake code at
-
-    .*/Tests/RunCMake/Syntax/StringNoSpace.cmake:2:28
+CMake Warning \(dev\) at StringNoSpace.cmake:2:
+  Syntax Warning in cmake code at 2:28
 
   Argument not separated from preceding token by whitespace.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
 
-CMake Warning \(dev\) in StringNoSpace.cmake:
-  Syntax Warning in cmake code at
-
-    .*/Tests/RunCMake/Syntax/StringNoSpace.cmake:2:31
+CMake Warning \(dev\) at StringNoSpace.cmake:2:
+  Syntax Warning in cmake code at 2:31
 
   Argument not separated from preceding token by whitespace.
 Call Stack \(most recent call first\):
@@ -20,4 +16,4 @@ This warning is for project developers.  Use -Wno-dev to suppress it.
 
 \[1 \${var} \\n 4\]
 \[x\]
-\[y\]$
+\[y\]
diff --git a/Tests/RunCMake/Syntax/UnterminatedBracket0-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBracket0-stderr.txt
index 3559c18..2fca570 100644
--- a/Tests/RunCMake/Syntax/UnterminatedBracket0-stderr.txt
+++ b/Tests/RunCMake/Syntax/UnterminatedBracket0-stderr.txt
@@ -1,8 +1,5 @@
-CMake Error: Error in cmake code at
-.*/Syntax/UnterminatedBracket0.cmake:2:
-Parse error.  Function missing ending "\)".  Instead found unterminated bracket with text "\)
-".
-CMake Error at CMakeLists.txt:3 \(include\):
-  include could not find load file:
+CMake Error at UnterminatedBracket0.cmake:2:
+  Parse error.  Function missing ending "\)".  Instead found unterminated
+  bracket with text "\)
 
-    UnterminatedBracket0.cmake$
+  ".
diff --git a/Tests/RunCMake/Syntax/UnterminatedBracket1-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBracket1-stderr.txt
index 55d458b..a999d9f 100644
--- a/Tests/RunCMake/Syntax/UnterminatedBracket1-stderr.txt
+++ b/Tests/RunCMake/Syntax/UnterminatedBracket1-stderr.txt
@@ -1,8 +1,5 @@
-CMake Error: Error in cmake code at
-.*/Syntax/UnterminatedBracket1.cmake:2:
-Parse error.  Function missing ending "\)".  Instead found unterminated bracket with text "\]\]\)
-".
-CMake Error at CMakeLists.txt:3 \(include\):
-  include could not find load file:
+CMake Error at UnterminatedBracket1.cmake:2:
+  Parse error.  Function missing ending "\)".  Instead found unterminated
+  bracket with text "\]\]\)
 
-    UnterminatedBracket1.cmake$
+  ".
diff --git a/Tests/RunCMake/Syntax/UnterminatedBracketComment-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBracketComment-stderr.txt
index 0a799eb..39de20d 100644
--- a/Tests/RunCMake/Syntax/UnterminatedBracketComment-stderr.txt
+++ b/Tests/RunCMake/Syntax/UnterminatedBracketComment-stderr.txt
@@ -1,8 +1,5 @@
-CMake Error: Error in cmake code at
-.*/Syntax/UnterminatedBracketComment.cmake:1:
-Parse error.  Expected a command name, got unterminated bracket with text "#\]\]
-".
-CMake Error at CMakeLists.txt:3 \(include\):
-  include could not find load file:
+CMake Error at UnterminatedBracketComment.cmake:3:
+  Parse error.  Expected a command name, got unterminated bracket with text
+  "#\]\]
 
-    UnterminatedBracketComment.cmake
+  ".
diff --git a/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt
index 281ce0d..3f52244 100644
--- a/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt
+++ b/Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt
@@ -1,7 +1,4 @@
-CMake Error: Error in cmake code at
-.*/Syntax/UnterminatedCall1.cmake:2:
-Parse error.  Function missing ending "\)".  End of file reached.
-CMake Error at CMakeLists.txt:3 \(include\):
-  include could not find load file:
-
-    UnterminatedCall1.cmake
+CMake Error at UnterminatedCall1.cmake:2:
+  Parse error.  Function missing ending "\)".  End of file reached.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt
index 065de30..dabc168 100644
--- a/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt
+++ b/Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt
@@ -1,7 +1,2 @@
-CMake Error: Error in cmake code at
-.*/Syntax/UnterminatedCall2.cmake:4:
-Parse error.  Function missing ending "\)".  End of file reached.
-CMake Error at CMakeLists.txt:3 \(include\):
-  include could not find load file:
-
-    UnterminatedCall2.cmake
+CMake Error at UnterminatedCall2.cmake:4:
+  Parse error.  Function missing ending "\)".  End of file reached.
diff --git a/Tests/RunCMake/Syntax/UnterminatedString-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedString-stderr.txt
index d925032..a8c0a75 100644
--- a/Tests/RunCMake/Syntax/UnterminatedString-stderr.txt
+++ b/Tests/RunCMake/Syntax/UnterminatedString-stderr.txt
@@ -1,8 +1,5 @@
-CMake Error: Error in cmake code at
-.*/Syntax/UnterminatedString.cmake:2:
-Parse error.  Function missing ending "\)".  Instead found unterminated string with text "\)
-".
-CMake Error at CMakeLists.txt:3 \(include\):
-  include could not find load file:
+CMake Error at UnterminatedString.cmake:2:
+  Parse error.  Function missing ending "\)".  Instead found unterminated
+  string with text "\)
 
-    UnterminatedString.cmake$
+  ".

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2f0b2d660ba137205b02303ebb1c72fcf694b2c4
commit 2f0b2d660ba137205b02303ebb1c72fcf694b2c4
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Thu Jan 28 22:10:24 2016 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sun Jun 12 18:39:39 2016 +0200

    Parser: Store the Backtrace for use in issuing messages

diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 036a2b1..9ede8c6 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -29,6 +29,7 @@ struct cmListFileParser
                    cmListFileArgument::Delimiter delim);
   cmListFile* ListFile;
   cmMakefile* Makefile;
+  cmListFileBacktrace Backtrace;
   const char* FileName;
   cmListFileLexer* Lexer;
   cmListFileFunction Function;
@@ -44,6 +45,7 @@ cmListFileParser::cmListFileParser(cmListFile* lf, cmMakefile* mf,
                                    const char* filename)
   : ListFile(lf)
   , Makefile(mf)
+  , Backtrace(this->Makefile->GetBacktrace())
   , FileName(filename)
   , Lexer(cmListFileLexer_New())
 {

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

Summary of changes:
 Source/cmListFileCache.cxx                         |  165 ++++++--------------
 Source/cmListFileCache.h                           |    2 +-
 Source/cmMakefile.cxx                              |   79 +++++++++-
 Tests/RunCMake/Syntax/BOM-UTF-16-BE-stderr.txt     |    6 +-
 Tests/RunCMake/Syntax/BOM-UTF-16-LE-stderr.txt     |    6 +-
 Tests/RunCMake/Syntax/BOM-UTF-32-BE-stderr.txt     |    6 +-
 Tests/RunCMake/Syntax/BOM-UTF-32-LE-stderr.txt     |    6 +-
 Tests/RunCMake/Syntax/BracketComment4-stderr.txt   |    9 +-
 Tests/RunCMake/Syntax/BracketNoSpace0-stderr.txt   |    8 +-
 Tests/RunCMake/Syntax/BracketNoSpace1-stderr.txt   |    8 +-
 Tests/RunCMake/Syntax/BracketNoSpace2-stderr.txt   |    8 +-
 Tests/RunCMake/Syntax/BracketNoSpace3-stderr.txt   |    8 +-
 Tests/RunCMake/Syntax/BracketNoSpace4-stderr.txt   |    8 +-
 Tests/RunCMake/Syntax/BracketNoSpace5-stderr.txt   |    8 +-
 Tests/RunCMake/Syntax/CommandError0-stderr.txt     |   10 +-
 Tests/RunCMake/Syntax/CommandError1-stderr.txt     |    9 +-
 Tests/RunCMake/Syntax/CommandError2-stderr.txt     |   10 +-
 Tests/RunCMake/Syntax/ParenInENV-stderr.txt        |    8 +-
 Tests/RunCMake/Syntax/ParenNoSpace1-stderr.txt     |   20 +--
 Tests/RunCMake/Syntax/StringNoSpace-stderr.txt     |   14 +-
 .../Syntax/UnterminatedBracket0-stderr.txt         |   11 +-
 .../Syntax/UnterminatedBracket1-stderr.txt         |   11 +-
 .../Syntax/UnterminatedBracketComment-stderr.txt   |   11 +-
 Tests/RunCMake/Syntax/UnterminatedCall1-stderr.txt |   11 +-
 Tests/RunCMake/Syntax/UnterminatedCall2-stderr.txt |    9 +-
 .../RunCMake/Syntax/UnterminatedString-stderr.txt  |   11 +-
 26 files changed, 190 insertions(+), 272 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list