[Cmake-commits] CMake branch, next, updated. v3.0.0-rc4-2759-g9f05693

Brad King brad.king at kitware.com
Mon May 5 12:51:25 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  9f056934c12d57063642360a987af0977b60f5b6 (commit)
       via  3db92087bdb30b918841b3e16c3e592ecd47e4c9 (commit)
      from  e9f70ab1dd5f7b6454a9c769a2f238581db47951 (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=9f056934c12d57063642360a987af0977b60f5b6
commit 9f056934c12d57063642360a987af0977b60f5b6
Merge: e9f70ab 3db9208
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon May 5 12:51:24 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Mon May 5 12:51:24 2014 -0400

    Merge topic 'dev/faster-evis' into next
    
    3db92087 CMP0053: Revise wording and whitespace in policy warning


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=3db92087bdb30b918841b3e16c3e592ecd47e4c9
commit 3db92087bdb30b918841b3e16c3e592ecd47e4c9
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Mon May 5 12:49:20 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Mon May 5 12:49:20 2014 -0400

    CMP0053: Revise wording and whitespace in policy warning
    
    Write out the behavior change in prose.  Clarify appearance of message
    when the input string contains newlines by indenting them too.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index b6455b1..1cae865 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -2651,21 +2651,43 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
   // ...otherwise, see if there's a difference that needs to be warned about.
   else if(compareResults && (newResult != source || newError != mtype))
     {
-    std::string message =
+    std::string msg =
       this->GetPolicies()->GetPolicyWarning(cmPolicies::CMP0053);
-    message += "\n  Input: \'" + original + "\'";
-    if(newError != mtype)
+    msg += "\n";
+
+    std::string msg_input = original;
+    cmSystemTools::ReplaceString(msg_input, "\n", "\n  ");
+    msg += "For input:\n  '";
+    msg += msg_input;
+    msg += "'\n";
+
+    std::string msg_old = source;
+    cmSystemTools::ReplaceString(msg_old, "\n", "\n  ");
+    msg += "the old evaluation rules produce:\n  '";
+    msg += msg_old;
+    msg += "'\n";
+
+    if(newError == mtype)
       {
-      message += "\n  Old behavior is accepted and "
-                 "the new behavior causes an error: "
-                 "\'" + newErrorstr + "\'";
+      std::string msg_new = newResult;
+      cmSystemTools::ReplaceString(msg_new, "\n", "\n  ");
+      msg += "but the new evaluation rules produce:\n  '";
+      msg += msg_new;
+      msg += "'\n";
       }
     else
       {
-      message += "\n  Old expansion: \'" + source + "\'";
-      message += "\n  New expansion: \'" + newResult + "\'";
+      std::string msg_err = newErrorstr;
+      cmSystemTools::ReplaceString(msg_err, "\n", "\n  ");
+      msg += "but the new evaluation rules produce an error:\n  ";
+      msg += msg_err;
+      msg += "\n";
       }
-    this->IssueMessage(cmake::AUTHOR_WARNING, message);
+
+    msg +=
+      "Using the old result for compatibility since the policy is not set.";
+
+    this->IssueMessage(cmake::AUTHOR_WARNING, msg);
     }
 
   return source.c_str();
diff --git a/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt
similarity index 54%
copy from Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt
copy to Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt
index 48b6a24..ec37021 100644
--- a/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt
+++ b/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt
@@ -1,11 +1,27 @@
-^CMake Warning \(dev\) at CMP0053-At-WARN.cmake:4 \(set\):
+^CMake Warning \(dev\) at CMP0053-At-WARN-newlines.cmake:4 \(set\):
   Policy CMP0053 is not set: Simplify variable reference and escape sequence
   evaluation.  Run "cmake --help-policy CMP0053" for policy details.  Use the
   cmake_policy command to set the policy and suppress this warning.
 
-    Input: '@var@'
-    Old expansion: '\${right}'
-    New expansion: '@var@'
+  For input:
+
+    '
+    @var@
+    '
+
+  the old evaluation rules produce:
+
+    '
+    \${right}
+    '
+
+  but the new evaluation rules produce:
+
+    '
+    @var@
+    '
+
+  Using the old result for compatibility since the policy is not set.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines.cmake b/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines.cmake
new file mode 100644
index 0000000..c493505
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines.cmake
@@ -0,0 +1,6 @@
+set(right "wrong")
+set(var "\${right}")
+# Expanded here with the old policy.
+set(ref "
+ at var@
+")
diff --git a/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt
index 48b6a24..697b7b3 100644
--- a/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt
+++ b/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt
@@ -3,9 +3,19 @@
   evaluation.  Run "cmake --help-policy CMP0053" for policy details.  Use the
   cmake_policy command to set the policy and suppress this warning.
 
-    Input: '@var@'
-    Old expansion: '\${right}'
-    New expansion: '@var@'
+  For input:
+
+    '@var@'
+
+  the old evaluation rules produce:
+
+    '\${right}'
+
+  but the new evaluation rules produce:
+
+    '@var@'
+
+  Using the old result for compatibility since the policy is not set.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt
index 5ab2846c..09c7e7c 100644
--- a/Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt
+++ b/Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt
@@ -3,15 +3,23 @@
   evaluation.  Run "cmake --help-policy CMP0053" for policy details.  Use the
   cmake_policy command to set the policy and suppress this warning.
 
-    Input: '\\0'
-    Old behavior is accepted and the new behavior causes an error: 'Syntax error in cmake code at
-    .*/Tests/RunCMake/Syntax/CMP0053-NUL.cmake:1
+  For input:
 
-  when parsing string
+    '\\0'
 
-    \\0
+  the old evaluation rules produce:
 
-  Invalid character escape '\\0'.'
+    ''
+
+  but the new evaluation rules produce an error:
+
+    Syntax error in cmake code at
+      .*/Tests/RunCMake/Syntax/CMP0053-NUL.cmake:1
+    when parsing string
+      \\0
+    Invalid character escape '\\0'.
+
+  Using the old result for compatibility since the policy is not set.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
@@ -21,15 +29,23 @@ CMake Warning \(dev\) at CMP0053-NUL.cmake:2 \(set\):
   evaluation.  Run "cmake --help-policy CMP0053" for policy details.  Use the
   cmake_policy command to set the policy and suppress this warning.
 
-    Input: '\\0'
-    Old behavior is accepted and the new behavior causes an error: 'Syntax error in cmake code at
-    .*/Tests/RunCMake/Syntax/CMP0053-NUL.cmake:2
+  For input:
+
+    '\\0'
+
+  the old evaluation rules produce:
+
+    ''
 
-  when parsing string
+  but the new evaluation rules produce an error:
 
-    \\0
+    Syntax error in cmake code at
+      .*/Tests/RunCMake/Syntax/CMP0053-NUL.cmake:2
+    when parsing string
+      \\0
+    Invalid character escape '\\0'.
 
-  Invalid character escape '\\0'.'
+  Using the old result for compatibility since the policy is not set.
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)
 This warning is for project developers.  Use -Wno-dev to suppress it.
diff --git a/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt
index 3443603..c706939 100644
--- a/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt
+++ b/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt
@@ -3,15 +3,23 @@
   evaluation.  Run "cmake --help-policy CMP0053" for policy details.  Use the
   cmake_policy command to set the policy and suppress this warning.
 
-    Input: '\\'
-    Old behavior is accepted and the new behavior causes an error: 'Syntax error in cmake code at
-    .*/Tests/RunCMake/Syntax/CMP0053-WARN.cmake:2
+  For input:
 
-  when parsing string
+    '\\'
 
-    \\
+  the old evaluation rules produce:
 
-  Invalid character escape '\\' \(at end of input\).'
+    '\\'
+
+  but the new evaluation rules produce an error:
+
+    Syntax error in cmake code at
+      .*/Tests/RunCMake/Syntax/CMP0053-WARN.cmake:2
+    when parsing string
+      \\
+    Invalid character escape '\\' \(at end of input\).
+
+  Using the old result for compatibility since the policy is not set.
 Call Stack \(most recent call first\):
   CMP0053-WARN.cmake:5 \(escape\)
   CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index 7c94e1a..53c8d6b 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -8,6 +8,7 @@ run_cmake(BOM-UTF-32-BE)
 run_cmake(CMP0053-At-OLD)
 run_cmake(CMP0053-At-NEW)
 run_cmake(CMP0053-At-WARN)
+run_cmake(CMP0053-At-WARN-newlines)
 run_cmake(CMP0053-WARN)
 run_cmake(CMP0053-NUL)
 run_cmake(CMP0053-ParenInENV)

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

Summary of changes:
 Source/cmMakefile.cxx                              |   40 +++++++++++++++-----
 ...err.txt => CMP0053-At-WARN-newlines-stderr.txt} |   24 ++++++++++--
 ...t-WARN.cmake => CMP0053-At-WARN-newlines.cmake} |    4 +-
 Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt   |   16 ++++++--
 Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt       |   40 ++++++++++++++------
 Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt      |   20 +++++++---
 Tests/RunCMake/Syntax/RunCMakeTest.cmake           |    1 +
 7 files changed, 110 insertions(+), 35 deletions(-)
 copy Tests/RunCMake/Syntax/{CMP0053-At-WARN-stderr.txt => CMP0053-At-WARN-newlines-stderr.txt} (54%)
 copy Tests/RunCMake/Syntax/{CMP0053-At-WARN.cmake => CMP0053-At-WARN-newlines.cmake} (80%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list