[Cmake-commits] CMake branch, next, updated. v3.0.0-4645-g886d33e

Brad King brad.king at kitware.com
Wed Jul 30 13:45:21 EDT 2014


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  886d33ef24971c5cbb8934f6c180ea5b3c037f3b (commit)
       via  8669a33ee8f445598b177a079989e5bd2b3ea224 (commit)
      from  93cb9ad1d12e5d2b5ce64dda69eac7abf12506ca (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=886d33ef24971c5cbb8934f6c180ea5b3c037f3b
commit 886d33ef24971c5cbb8934f6c180ea5b3c037f3b
Merge: 93cb9ad 8669a33
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jul 30 13:45:20 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jul 30 13:45:20 2014 -0400

    Merge topic 'fix-CMP0049-extra-error' into next
    
    8669a33e cmTarget: Do not mistake a preceding error for a CMP0049 failure


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8669a33ee8f445598b177a079989e5bd2b3ea224
commit 8669a33ee8f445598b177a079989e5bd2b3ea224
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jul 30 13:39:27 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jul 30 13:40:10 2014 -0400

    cmTarget: Do not mistake a preceding error for a CMP0049 failure
    
    After calls to ProcessSourceItemCMP0049, check for an empty return
    string to detect a failure instead of trusting GetErrorOccuredFlag.
    The latter could have been left from a preceding non-fatal error.
    
    Extend the RunCMake.Configure test to cover a case that exposed this
    problem.

diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index ca24d2d..acae0b3 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -927,10 +927,13 @@ void cmTarget::AddSources(std::vector<std::string> const& srcs)
 
     if(!(src[0] == '$' && src[1] == '<'))
       {
-      filename = this->ProcessSourceItemCMP0049(filename);
-      if (cmSystemTools::GetErrorOccuredFlag())
+      if(!filename.empty())
         {
-        return;
+        filename = this->ProcessSourceItemCMP0049(filename);
+        if(filename.empty())
+          {
+          return;
+          }
         }
       this->Makefile->GetOrCreateSource(filename);
       }
@@ -998,8 +1001,7 @@ std::string cmTarget::ProcessSourceItemCMP0049(const std::string& s)
 cmSourceFile* cmTarget::AddSourceCMP0049(const std::string& s)
 {
   std::string src = this->ProcessSourceItemCMP0049(s);
-
-  if (cmSystemTools::GetErrorOccuredFlag())
+  if(!s.empty() && src.empty())
     {
     return 0;
     }
diff --git a/Tests/RunCMake/Configure/CustomTargetAfterError-result.txt b/Tests/RunCMake/Configure/CustomTargetAfterError-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Configure/CustomTargetAfterError-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Configure/CustomTargetAfterError-stderr.txt b/Tests/RunCMake/Configure/CustomTargetAfterError-stderr.txt
new file mode 100644
index 0000000..7ce7daf
--- /dev/null
+++ b/Tests/RunCMake/Configure/CustomTargetAfterError-stderr.txt
@@ -0,0 +1,9 @@
+^CMake Error at CustomTargetAfterError.cmake:1 \(message\):
+  Error before add_custom_target
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
++
+CMake Error at CustomTargetAfterError.cmake:3 \(message\):
+  Error after add_custom_target
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Configure/CustomTargetAfterError.cmake b/Tests/RunCMake/Configure/CustomTargetAfterError.cmake
new file mode 100644
index 0000000..3e26455
--- /dev/null
+++ b/Tests/RunCMake/Configure/CustomTargetAfterError.cmake
@@ -0,0 +1,3 @@
+message(SEND_ERROR "Error before add_custom_target")
+add_custom_target(foo COMMAND echo)
+message(SEND_ERROR "Error after add_custom_target")
diff --git a/Tests/RunCMake/Configure/RunCMakeTest.cmake b/Tests/RunCMake/Configure/RunCMakeTest.cmake
index 5ef0384..1628d82 100644
--- a/Tests/RunCMake/Configure/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Configure/RunCMakeTest.cmake
@@ -2,6 +2,7 @@ include(RunCMake)
 
 run_cmake(ErrorLogs)
 run_cmake(FailCopyFileABI)
+run_cmake(CustomTargetAfterError)
 
 # Use a single build tree for a few tests without cleaning.
 set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build)

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

Summary of changes:
 Source/cmTarget.cxx                                        |   12 +++++++-----
 .../CustomTargetAfterError-result.txt}                     |    0
 Tests/RunCMake/Configure/CustomTargetAfterError-stderr.txt |    9 +++++++++
 Tests/RunCMake/Configure/CustomTargetAfterError.cmake      |    3 +++
 Tests/RunCMake/Configure/RunCMakeTest.cmake                |    1 +
 5 files changed, 20 insertions(+), 5 deletions(-)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => Configure/CustomTargetAfterError-result.txt} (100%)
 create mode 100644 Tests/RunCMake/Configure/CustomTargetAfterError-stderr.txt
 create mode 100644 Tests/RunCMake/Configure/CustomTargetAfterError.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list