[Cmake-commits] CMake branch, next, updated. v2.8.3-763-g7a51a21

Ben Boeckel ben.boeckel at kitware.com
Tue Dec 7 16:48:28 EST 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  7a51a2131a40aca492ed26b5ffa0686f99dad5ed (commit)
       via  4e3bea41ee939a039b53d5963f459c354bcb2b42 (commit)
       via  8e8c9e49243674579545d5f27101597604c96f12 (commit)
       via  668e005db5d9cece95965e23b8c589bd50a29faa (commit)
      from  f8719ead3fd52e6a97bc873fc1195bf552800ed1 (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=7a51a2131a40aca492ed26b5ffa0686f99dad5ed
commit 7a51a2131a40aca492ed26b5ffa0686f99dad5ed
Merge: f8719ea 4e3bea4
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Dec 7 16:48:25 2010 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Dec 7 16:48:25 2010 -0500

    Merge topic 'dev/strict-mode' into next
    
    4e3bea4 Update expected messages to new format
    8e8c9e4 Don't check at destruction for usage
    668e005 Use cmake::IssueMessage for warnings


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4e3bea41ee939a039b53d5963f459c354bcb2b42
commit 4e3bea41ee939a039b53d5963f459c354bcb2b42
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Dec 7 16:46:10 2010 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Tue Dec 7 16:46:10 2010 -0500

    Update expected messages to new format

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 4cfbf93..b60a610 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1099,9 +1099,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-project WarnUnusedUnusedViaSet
     --build-options "--warn-unused-vars")
   SET_TESTS_PROPERTIES(WarnUnusedUnusedViaSet PROPERTIES
-    PASS_REGULAR_EXPRESSION "CMake Warning: \\(changing definition\\) unused variable 'UNUSED_VARIABLE'")
+    PASS_REGULAR_EXPRESSION "unused variable \\(changing definition\\) 'UNUSED_VARIABLE'")
   SET_TESTS_PROPERTIES(WarnUnusedUnusedViaSet PROPERTIES
-    FAIL_REGULAR_EXPRESSION "CMake Warning: \\(unsetting\\) unused variable 'UNUSED_VARIABLE'")
+    FAIL_REGULAR_EXPRESSION "unused variable \\(unsetting\\) 'UNUSED_VARIABLE'")
   LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet")
 
   ADD_TEST(WarnUnusedUnusedViaUnset ${CMAKE_CTEST_COMMAND}
@@ -1114,9 +1114,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-project WarnUnusedUnusedViaUnset
     --build-options "--warn-unused-vars")
   SET_TESTS_PROPERTIES(WarnUnusedUnusedViaUnset PROPERTIES
-    PASS_REGULAR_EXPRESSION ":7: CMake Warning: \\(unsetting\\) unused variable 'UNUSED_VARIABLE'")
+    PASS_REGULAR_EXPRESSION "CMake Warning .*:7 \\(set\\):")
   SET_TESTS_PROPERTIES(WarnUnusedUnusedViaUnset PROPERTIES
-    FAIL_REGULAR_EXPRESSION ":5: CMake Warning: \\(unsetting\\) unused variable 'UNUSED_VARIABLE'")
+    FAIL_REGULAR_EXPRESSION "CMake Warning .*:5 \\(set\\):")
   LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset")
 
   ADD_TEST(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND}

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8e8c9e49243674579545d5f27101597604c96f12
commit 8e8c9e49243674579545d5f27101597604c96f12
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Dec 7 16:38:37 2010 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Tue Dec 7 16:38:37 2010 -0500

    Don't check at destruction for usage

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e22ade3..9ccde8f 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -181,9 +181,6 @@ bool cmMakefile::NeedCacheCompatibility(int major, int minor)
 
 cmMakefile::~cmMakefile()
 {
-  // Check for unused variables
-  this->CheckForUnusedVariables();
-
   for(std::vector<cmInstallGenerator*>::iterator
         i = this->InstallGenerators.begin();
       i != this->InstallGenerators.end(); ++i)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=668e005db5d9cece95965e23b8c589bd50a29faa
commit 668e005db5d9cece95965e23b8c589bd50a29faa
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Dec 7 16:38:25 2010 -0500
Commit:     Ben Boeckel <ben.boeckel at kitware.com>
CommitDate: Tue Dec 7 16:38:25 2010 -0500

    Use cmake::IssueMessage for warnings

diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index decdaaa..a781767 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -137,9 +137,14 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
                                      this->Makefile->GetHomeOutputDirectory()))
         {
         cmOStringStream msg;
-        msg << this->FileName << ":" << this->FileLine << ":" <<
-          " CMake Warning: uninitialized variable \'" << var << "\'";
-        cmSystemTools::Message(msg.str().c_str());
+        cmListFileBacktrace bt;
+        cmListFileContext lfc;
+        lfc.FilePath = this->FileName;
+        lfc.Line = this->FileLine;
+        bt.push_back(lfc);
+        msg << "uninitialized variable \'" << var << "\'";
+        this->Makefile->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING,
+                                                        msg.str().c_str(), bt);
         }
       }
     return 0;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 016d5fe..e22ade3 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1777,18 +1777,21 @@ void cmMakefile::CheckForUnused(const char* reason, const char* name) const
   if (this->WarnUnused && !this->VariableUsed(name))
     {
     cmStdString path;
-    long line;
+    cmListFileBacktrace bt;
     if (this->CallStack.size())
       {
       const cmListFileContext* file = this->CallStack.back().Context;
+      bt.push_back(*file);
       path = file->FilePath.c_str();
-      line = file->Line;
       }
     else
       {
       path = this->GetStartDirectory();
       path += "/CMakeLists.txt";
-      line = 0;
+      cmListFileContext lfc;
+      lfc.FilePath = path;
+      lfc.Line = 0;
+      bt.push_back(lfc);
       }
     if (this->CheckSystemVars ||
         cmSystemTools::IsSubDirectory(path.c_str(),
@@ -1799,9 +1802,10 @@ void cmMakefile::CheckForUnused(const char* reason, const char* name) const
                                 cmake::GetCMakeFilesDirectory())))
       {
       cmOStringStream msg;
-      msg << path << ":" << line << ":" <<
-        " CMake Warning: (" << reason << ") unused variable \'" << name << "\'";
-      cmSystemTools::Message(msg.str().c_str());
+      msg << "unused variable (" << reason << ") \'" << name << "\'";
+      this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING,
+                                             msg.str().c_str(),
+                                             bt);
       }
     }
 }

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

Summary of changes:
 Source/cmCommandArgumentParserHelper.cxx |   11 ++++++++---
 Source/cmMakefile.cxx                    |   19 ++++++++++---------
 Tests/CMakeLists.txt                     |    8 ++++----
 3 files changed, 22 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list