[Cmake-commits] CMake branch, next, updated. v3.0.0-rc4-3069-gd43bedd

Brad King brad.king at kitware.com
Thu May 8 13:25:04 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  d43bedd09434e762116846b78043148dbc95c670 (commit)
       via  90f66381d3a8f5ba4fd5393e2ce9032d617f08bc (commit)
       via  6804cd042e367954c9cf8d52392f1c3f59aaed70 (commit)
       via  411f77d14f0cea36aeaf04b01d3fdf2ea7ec2173 (commit)
       via  bc3856586388a610ef3d06d51c212a9ed25856c4 (commit)
       via  25102efc1db1e0d165ebe5e4eaef33b8206d9d3e (commit)
       via  e423f1c05d6d11483deb7acd135623df8de45655 (commit)
       via  c179b2898eb507c0e4e169665d8698f1efb05f16 (commit)
       via  c3d98bd28994bea455a1a2ca37c2a693aa9415a7 (commit)
      from  414ea1c2eaae96a193b8da72016d3a70f5e0d490 (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=d43bedd09434e762116846b78043148dbc95c670
commit d43bedd09434e762116846b78043148dbc95c670
Merge: 414ea1c 90f6638
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu May 8 13:25:01 2014 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu May 8 13:25:01 2014 -0400

    Merge topic 'dev/faster-evis' into next
    
    90f66381 Help: Add release notes for policy CMP0053
    6804cd04 Help: Add documentation on escaping changes with CMP0053
    411f77d1 EVIS: Add tests for syntax corner cases and CMP0053
    bc385658 EVIS: Reimplement using custom parsing code
    25102efc EVIS: Add policy CMP0053
    e423f1c0 Windows: Avoid () in environment variable references
    c179b289 Help: Add more reference targets to cmake-language.7
    c3d98bd2 Utilities/Release: Use ${VAR} instead of @VAR@ syntax


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=90f66381d3a8f5ba4fd5393e2ce9032d617f08bc
commit 90f66381d3a8f5ba4fd5393e2ce9032d617f08bc
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu May 8 11:56:55 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu May 8 13:24:50 2014 -0400

    Help: Add release notes for policy CMP0053

diff --git a/Help/release/dev/CMP0053.rst b/Help/release/dev/CMP0053.rst
new file mode 100644
index 0000000..3b835fb
--- /dev/null
+++ b/Help/release/dev/CMP0053.rst
@@ -0,0 +1,6 @@
+CMP0053
+-------
+
+* The :manual:`cmake-language(7)` syntax for :ref:`Variable References` and
+  :ref:`Escape Sequences` was simplified in order to allow a much faster
+  implementation.  See policy :policy:`CMP0053`.

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6804cd042e367954c9cf8d52392f1c3f59aaed70
commit 6804cd042e367954c9cf8d52392f1c3f59aaed70
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Thu May 1 14:47:18 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu May 8 13:24:50 2014 -0400

    Help: Add documentation on escaping changes with CMP0053

diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst
index 5bbe16e..b83dcad 100644
--- a/Help/manual/cmake-language.7.rst
+++ b/Help/manual/cmake-language.7.rst
@@ -296,16 +296,18 @@ An *escape sequence* is a ``\`` followed by one character:
 
 .. productionlist::
  escape_sequence: `escape_identity` | `escape_encoded` | `escape_semicolon`
- escape_identity: '\(' | '\)' | '\#' | '\"' | '\ ' |
-                : '\\' | '\$' | '\@' | '\^'
+ escape_identity: '\' <match '[^A-Za-z0-9;]'>
  escape_encoded: '\t' | '\r' | '\n'
  escape_semicolon: '\;'
 
-A ``\`` followed by one of ``()#" \#@^`` simply encodes the literal
+A ``\`` followed by a non-alphanumeric character simply encodes the literal
 character without interpreting it as syntax.  A ``\t``, ``\r``, or ``\n``
-encodes a tab, carriage return, or newline character, respectively.
-A ``\;`` encodes itself but may be used in an `Unquoted Argument`_
-to encode the ``;`` without dividing the argument value on it.
+encodes a tab, carriage return, or newline character, respectively. A ``\;``
+outside of any `Variable References`_  encodes itself but may be used in an
+`Unquoted Argument`_ to encode the ``;`` without dividing the argument
+value on it.  A ``\;`` inside `Variable References`_ encodes the literal
+``;`` character.  (See also policy :policy:`CMP0053` documentation for
+historical considerations.)
 
 .. _`Variable References`:
 
@@ -319,6 +321,11 @@ or by the empty string if the variable is not set.
 Variable references can nest and are evaluated from the
 inside out, e.g. ``${outer_${inner_variable}_variable}``.
 
+Literal variable references may consist of alphanumeric characters,
+the characters ``/_.+-``, and `Escape Sequences`_.  Nested references
+may be used to evaluate variables of any name.  (See also policy
+:policy:`CMP0053` documentation for historical considerations.)
+
 The `Variables`_ section documents the scope of variable names
 and how their values are set.
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=411f77d14f0cea36aeaf04b01d3fdf2ea7ec2173
commit 411f77d14f0cea36aeaf04b01d3fdf2ea7ec2173
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Tue Feb 18 14:47:56 2014 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu May 8 13:24:49 2014 -0400

    EVIS: Add tests for syntax corner cases and CMP0053
    
    Include tests for:
    
    - @ expansion during normal execution
    - various characters in variable names for comparison between the new
      and the old parser
    - corner cases in the parsers
    - correct messages when behavior is different

diff --git a/Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt
new file mode 100644
index 0000000..e3e5332
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-NEW-stderr.txt
@@ -0,0 +1 @@
+^-->\${right}<--$
diff --git a/Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake b/Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake
new file mode 100644
index 0000000..40dbe46
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-NEW.cmake
@@ -0,0 +1,9 @@
+cmake_policy(SET CMP0053 NEW)
+
+set(right "wrong")
+set(var "\${right}")
+# Not expanded here with the new policy.
+set(ref "@var@")
+
+string(CONFIGURE "${ref}" output)
+message("-->${output}<--")
diff --git a/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt
new file mode 100644
index 0000000..acfa30a
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-OLD-stderr.txt
@@ -0,0 +1 @@
+^-->wrong<--$
diff --git a/Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake b/Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake
new file mode 100644
index 0000000..666f107
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-OLD.cmake
@@ -0,0 +1,9 @@
+cmake_policy(SET CMP0053 OLD)
+
+set(right "wrong")
+set(var "\${right}")
+# Expanded here with the old policy.
+set(ref "@var@")
+
+string(CONFIGURE "${ref}" output)
+message("-->${output}<--")
diff --git a/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt
new file mode 100644
index 0000000..ec37021
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-WARN-newlines-stderr.txt
@@ -0,0 +1,27 @@
+^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.
+
+  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
new file mode 100644
index 0000000..697b7b3
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-WARN-stderr.txt
@@ -0,0 +1,21 @@
+^CMake Warning \(dev\) at CMP0053-At-WARN.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.
+
+  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.cmake b/Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake
new file mode 100644
index 0000000..19c7f53
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-At-WARN.cmake
@@ -0,0 +1,4 @@
+set(right "wrong")
+set(var "\${right}")
+# Expanded here with the old policy.
+set(ref "@var@")
diff --git a/Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt
new file mode 100644
index 0000000..09c7e7c
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NUL-stderr.txt
@@ -0,0 +1,56 @@
+^CMake Warning \(dev\) at CMP0053-NUL.cmake:1 \(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.
+
+  For input:
+
+    '\\0'
+
+  the old evaluation rules produce:
+
+    ''
+
+  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.
+
+CMake Warning \(dev\) at CMP0053-NUL.cmake:2 \(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.
+
+  For input:
+
+    '\\0'
+
+  the old evaluation rules produce:
+
+    ''
+
+  but the new evaluation rules produce an error:
+
+    Syntax error in cmake code at
+      .*/Tests/RunCMake/Syntax/CMP0053-NUL.cmake:2
+    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.
+
+--><--
+--><--
+--><--
+--><--$
diff --git a/Tests/RunCMake/Syntax/CMP0053-NUL.cmake b/Tests/RunCMake/Syntax/CMP0053-NUL.cmake
new file mode 100644
index 0000000..9ae0906
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NUL.cmake
@@ -0,0 +1,6 @@
+set(qnul "\0")
+set(nul \0)
+message(-->${nul}<--)
+message(-->${qnul}<--)
+message("-->${nul}<--")
+message("-->${qnul}<--")
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-stderr.txt
new file mode 100644
index 0000000..9575778
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at CMP0053-NameWithCarriageReturn.cmake:2 \(message\):
+  message called with incorrect number of arguments
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn.cmake
new file mode 100644
index 0000000..b8a403d
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturn.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0053 NEW)
+message(${var\rwith\rcarriagereturn})
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturnQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturnQuoted.cmake
new file mode 100644
index 0000000..bb0d93f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithCarriageReturnQuoted.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0053 NEW)
+message("${var\rwith\rcarriagereturn}")
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-stderr.txt
new file mode 100644
index 0000000..df67d37
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at CMP0053-NameWithEscapedSpaces.cmake:2 \(message\):
+  message called with incorrect number of arguments
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces.cmake
new file mode 100644
index 0000000..805b2ca
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpaces.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0053 NEW)
+message(${var\ with\ escaped\ space})
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpacesQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpacesQuoted.cmake
new file mode 100644
index 0000000..58d8e8f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedSpacesQuoted.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0053 NEW)
+message("${var\ with\ escaped\ space}")
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-stderr.txt
new file mode 100644
index 0000000..059044f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at CMP0053-NameWithEscapedTabs.cmake:2 \(message\):
+  message called with incorrect number of arguments
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs.cmake
new file mode 100644
index 0000000..214ab5d
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabs.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0053 NEW)
+message(${var\	with\	escaped\	tab})
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabsQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabsQuoted.cmake
new file mode 100644
index 0000000..aa5123f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithEscapedTabsQuoted.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0053 NEW)
+message("${var\	with\	escaped\	tab}")
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-stderr.txt
new file mode 100644
index 0000000..41f86e6
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline-stderr.txt
@@ -0,0 +1,4 @@
+^CMake Error at CMP0053-NameWithNewline.cmake:2 \(message\):
+  message called with incorrect number of arguments
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithNewline.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline.cmake
new file mode 100644
index 0000000..45b532e
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithNewline.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0053 NEW)
+message(${var\nwith\nnewline})
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithNewlineQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithNewlineQuoted.cmake
new file mode 100644
index 0000000..6fe568d
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithNewlineQuoted.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0053 NEW)
+message("${var\nwith\nnewline}")
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-stderr.txt
new file mode 100644
index 0000000..95e8684
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at CMP0053-NameWithSpaces.cmake:2 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake:2
+
+  when parsing string
+
+    \${var
+
+  There is an unterminated variable reference.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake
new file mode 100644
index 0000000..dae7d25
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithSpaces.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0053 NEW)
+message(${var with space})
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-stderr.txt
new file mode 100644
index 0000000..c4f3cfe
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at CMP0053-NameWithSpacesQuoted.cmake:2 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake:2
+
+  when parsing string
+
+    \${var with space}
+
+  Invalid character \(' '\) in a variable name: 'var'
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake
new file mode 100644
index 0000000..e252cff
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithSpacesQuoted.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0053 NEW)
+message("${var with space}")
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-stderr.txt
new file mode 100644
index 0000000..b1678b3
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at CMP0053-NameWithTabs.cmake:2 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake:2
+
+  when parsing string
+
+    \${var
+
+  There is an unterminated variable reference.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake
new file mode 100644
index 0000000..45e3045
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithTabs.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0053 NEW)
+message(${var	with	tab})
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-result.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-stderr.txt
new file mode 100644
index 0000000..78adb5e
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at CMP0053-NameWithTabsQuoted.cmake:2 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake:2
+
+  when parsing string
+
+    \${var	with	tab}
+
+  Invalid character \('	'\) in a variable name: 'var'
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake
new file mode 100644
index 0000000..498675f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-NameWithTabsQuoted.cmake
@@ -0,0 +1,2 @@
+cmake_policy(SET CMP0053 NEW)
+message("${var	with	tab}")
diff --git a/Tests/RunCMake/Syntax/CMP0053-ParenInENV-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-ParenInENV-stderr.txt
new file mode 100644
index 0000000..7020c7e
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-ParenInENV-stderr.txt
@@ -0,0 +1 @@
+-->value<--
diff --git a/Tests/RunCMake/Syntax/CMP0053-ParenInENV.cmake b/Tests/RunCMake/Syntax/CMP0053-ParenInENV.cmake
new file mode 100644
index 0000000..b5cdf0f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-ParenInENV.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0053 NEW)
+set("ENV{e(x)}" value)
+message(-->$ENV{e\(x\)}<--)
diff --git a/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV-stderr.txt
new file mode 100644
index 0000000..7020c7e
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV-stderr.txt
@@ -0,0 +1 @@
+-->value<--
diff --git a/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV.cmake b/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV.cmake
new file mode 100644
index 0000000..5559d4b
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-ParenInQuotedENV.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0053 NEW)
+set("ENV{e(x)}" value)
+message("-->$ENV{e\(x\)}<--")
diff --git a/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt b/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt
new file mode 100644
index 0000000..c706939
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-WARN-stderr.txt
@@ -0,0 +1,28 @@
+^CMake Warning \(dev\) at CMP0053-WARN.cmake:2 \(message\):
+  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.
+
+  For input:
+
+    '\\'
+
+  the old evaluation rules produce:
+
+    '\\'
+
+  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\)
+This warning is for project developers.  Use -Wno-dev to suppress it.
+
+\\$
diff --git a/Tests/RunCMake/Syntax/CMP0053-WARN.cmake b/Tests/RunCMake/Syntax/CMP0053-WARN.cmake
new file mode 100644
index 0000000..6e8b07b
--- /dev/null
+++ b/Tests/RunCMake/Syntax/CMP0053-WARN.cmake
@@ -0,0 +1,5 @@
+macro (escape str)
+  message("${str}")
+endmacro ()
+
+escape("\\")
diff --git a/Tests/RunCMake/Syntax/CMakeLists.txt b/Tests/RunCMake/Syntax/CMakeLists.txt
index 618473a..4b3de84 100644
--- a/Tests/RunCMake/Syntax/CMakeLists.txt
+++ b/Tests/RunCMake/Syntax/CMakeLists.txt
@@ -1,3 +1,3 @@
-cmake_minimum_required(VERSION 2.8.9)
+cmake_minimum_required(VERSION 2.8.12)
 project(${RunCMake_TEST} NONE)
 include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/Syntax/Escape2-result.txt b/Tests/RunCMake/Syntax/Escape2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Escape2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/Escape2-stderr.txt b/Tests/RunCMake/Syntax/Escape2-stderr.txt
new file mode 100644
index 0000000..cc3bdf0
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Escape2-stderr.txt
@@ -0,0 +1,13 @@
+CMake Error at Escape2.cmake:4 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/Escape2.cmake:4
+
+  when parsing string
+
+    \\
+
+  Invalid character escape '\\' \(at end of input\).
+Call Stack \(most recent call first\):
+  Escape2.cmake:7 \(escape\)
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/Escape2.cmake b/Tests/RunCMake/Syntax/Escape2.cmake
new file mode 100644
index 0000000..078a822
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Escape2.cmake
@@ -0,0 +1,7 @@
+cmake_policy(SET CMP0053 NEW)
+
+macro (escape str)
+  message("${str}")
+endmacro ()
+
+escape("\\")
diff --git a/Tests/RunCMake/Syntax/EscapeChar-char-result.txt b/Tests/RunCMake/Syntax/EscapeChar-char-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/EscapeChar-char-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in b/Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in
new file mode 100644
index 0000000..d1d908c
--- /dev/null
+++ b/Tests/RunCMake/Syntax/EscapeChar-char-stderr.txt.in
@@ -0,0 +1,12 @@
+CMake Error at EscapeChar- at char@- at testnum@.cmake:3 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/EscapeChar- at char@- at testnum@.cmake:3
+
+  when parsing string
+
+    -->\\@char@<--
+
+  Invalid character escape '\\@char@'.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/EscapeChar-char.cmake.in b/Tests/RunCMake/Syntax/EscapeChar-char.cmake.in
new file mode 100644
index 0000000..6f265e5
--- /dev/null
+++ b/Tests/RunCMake/Syntax/EscapeChar-char.cmake.in
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0053 NEW)
+
+message("-->\@char@<--")
diff --git a/Tests/RunCMake/Syntax/EscapeCharsAllowed-stderr.txt b/Tests/RunCMake/Syntax/EscapeCharsAllowed-stderr.txt
new file mode 100644
index 0000000..e658de7
--- /dev/null
+++ b/Tests/RunCMake/Syntax/EscapeCharsAllowed-stderr.txt
@@ -0,0 +1,12 @@
+^-->semicolon<--
+-->dollar<--
+-->brace<--
+-->bracket<--
+-->newline<--
+-->octothorpe<--
+-->splat<--
+-->caret<--
+-->paren<--
+-->dquote<--
+-->top-levelsemicolon<--
+-->top-level;escaped;semicolon<--$
diff --git a/Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake b/Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake
new file mode 100644
index 0000000..e9c568d
--- /dev/null
+++ b/Tests/RunCMake/Syntax/EscapeCharsAllowed.cmake
@@ -0,0 +1,26 @@
+cmake_policy(SET CMP0053 NEW)
+
+set("semicolon;in;name" semicolon)
+set("dollar$in$name" dollar)
+set("brace{in}name" brace)
+set("bracket[in]name" bracket)
+set("newline\nin\nname" newline)
+set("octothorpe\#in\#name" octothorpe)
+set("splat\@in\@name" splat)
+set("caret\^in\^name" caret)
+set("paren\(in\)name" paren)
+set("dquote\"in\"name" dquote)
+
+message("-->${semicolon\;in\;name}<--")
+message("-->${dollar\$in\$name}<--")
+message("-->${brace\{in\}name}<--")
+message("-->${bracket\[in\]name}<--")
+message("-->${newline\nin\nname}<--")
+message("-->${octothorpe\#in\#name}<--")
+message("-->${splat\@in\@name}<--")
+message("-->${caret\^in\^name}<--")
+message("-->${paren\(in\)name}<--")
+message("-->${dquote\"in\"name}<--")
+
+message(-->top-level;semicolon<--)
+message(-->top-level\;escaped\;semicolon<--)
diff --git a/Tests/RunCMake/Syntax/EscapeCharsDisallowed.cmake b/Tests/RunCMake/Syntax/EscapeCharsDisallowed.cmake
new file mode 100644
index 0000000..eef01a0
--- /dev/null
+++ b/Tests/RunCMake/Syntax/EscapeCharsDisallowed.cmake
@@ -0,0 +1,42 @@
+set(disallowed_chars
+  a b c d e f g h i j l m   o p q   s   u v w x y z
+  A B C D E F G H I J L M N O P Q R S T U V W X Y Z
+  0 1 2 3 4 5 6 6 7 8 9)
+set(testnum 0)
+
+configure_file(
+  "${RunCMake_SOURCE_DIR}/CMakeLists.txt"
+  "${RunCMake_BINARY_DIR}/CMakeLists.txt"
+  COPYONLY)
+
+foreach (char IN LISTS disallowed_chars)
+  configure_file(
+    "${RunCMake_SOURCE_DIR}/EscapeChar-char.cmake.in"
+    "${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}.cmake"
+    @ONLY)
+  configure_file(
+    "${RunCMake_SOURCE_DIR}/EscapeChar-char-stderr.txt.in"
+    "${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}-stderr.txt"
+    @ONLY)
+  configure_file(
+    "${RunCMake_SOURCE_DIR}/EscapeChar-char-result.txt"
+    "${RunCMake_BINARY_DIR}/EscapeChar-${char}-${testnum}-result.txt"
+    COPYONLY)
+
+  math(EXPR testnum "${testnum} + 1")
+endforeach ()
+
+function (run_tests)
+  set(GENERATED_RUNCMAKE_TESTS TRUE)
+  # Find the tests in the binary directory.
+  set(RunCMake_SOURCE_DIR "${RunCMake_BINARY_DIR}")
+
+  set(testnum 0)
+  foreach (char IN LISTS disallowed_chars)
+    run_cmake("EscapeChar-${char}-${testnum}")
+
+    math(EXPR testnum "${testnum} + 1")
+  endforeach ()
+endfunction ()
+
+run_tests()
diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturn-result.txt b/Tests/RunCMake/Syntax/NameWithCarriageReturn-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithCarriageReturn-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt b/Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt
new file mode 100644
index 0000000..7448b59
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithCarriageReturn-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at NameWithCarriageReturn.cmake:1 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/NameWithCarriageReturn.cmake:1
+
+  when parsing string
+
+    \${var\\rwith\\rcarriagereturn}
+
+  syntax error, unexpected cal_SYMBOL, expecting } \(7\)
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturn.cmake b/Tests/RunCMake/Syntax/NameWithCarriageReturn.cmake
new file mode 100644
index 0000000..614f554
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithCarriageReturn.cmake
@@ -0,0 +1 @@
+message(${var\rwith\rcarriagereturn})
diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-stderr.txt
new file mode 100644
index 0000000..f5e03ed
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at NameWithCarriageReturnQuoted.cmake:1 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted.cmake:1
+
+  when parsing string
+
+    \${var\\rwith\\rcarriagereturn}
+
+  syntax error, unexpected cal_SYMBOL, expecting } \(7\)
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted.cmake b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted.cmake
new file mode 100644
index 0000000..bac69e4
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithCarriageReturnQuoted.cmake
@@ -0,0 +1 @@
+message("${var\rwith\rcarriagereturn}")
diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpaces-result.txt b/Tests/RunCMake/Syntax/NameWithEscapedSpaces-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithEscapedSpaces-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt b/Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt
new file mode 100644
index 0000000..fa16a8a
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithEscapedSpaces-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at NameWithEscapedSpaces.cmake:1 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/NameWithEscapedSpaces.cmake:1
+
+  when parsing string
+
+    \${var\\ with\\ escaped\\ space}
+
+  syntax error, unexpected cal_SYMBOL, expecting } \(7\)
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpaces.cmake b/Tests/RunCMake/Syntax/NameWithEscapedSpaces.cmake
new file mode 100644
index 0000000..6cb8401
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithEscapedSpaces.cmake
@@ -0,0 +1 @@
+message(${var\ with\ escaped\ space})
diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-stderr.txt
new file mode 100644
index 0000000..07cbf24
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at NameWithEscapedSpacesQuoted.cmake:1 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted.cmake:1
+
+  when parsing string
+
+    \${var\\ with\\ escaped\\ space}
+
+  syntax error, unexpected cal_SYMBOL, expecting } \(7\)
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted.cmake b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted.cmake
new file mode 100644
index 0000000..2bd4bfd
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithEscapedSpacesQuoted.cmake
@@ -0,0 +1 @@
+message("${var\ with\ escaped\ space}")
diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabs-result.txt b/Tests/RunCMake/Syntax/NameWithEscapedTabs-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithEscapedTabs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt b/Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt
new file mode 100644
index 0000000..d7fc38a
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithEscapedTabs-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at NameWithEscapedTabs.cmake:1 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/NameWithEscapedTabs.cmake:1
+
+  when parsing string
+
+    \${var\\	with\\	escaped\\	tab}
+
+  Invalid escape sequence \\.?
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabs.cmake b/Tests/RunCMake/Syntax/NameWithEscapedTabs.cmake
new file mode 100644
index 0000000..c6faa7a
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithEscapedTabs.cmake
@@ -0,0 +1 @@
+message(${var\	with\	escaped\	tab})
diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-stderr.txt
new file mode 100644
index 0000000..915dbaa
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at NameWithEscapedTabsQuoted.cmake:1 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted.cmake:1
+
+  when parsing string
+
+    \${var\\	with\\	escaped\\	tab}
+
+  Invalid escape sequence \\.?
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted.cmake b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted.cmake
new file mode 100644
index 0000000..d9be763
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithEscapedTabsQuoted.cmake
@@ -0,0 +1 @@
+message("${var\	with\	escaped\	tab}")
diff --git a/Tests/RunCMake/Syntax/NameWithNewline-result.txt b/Tests/RunCMake/Syntax/NameWithNewline-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithNewline-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/NameWithNewline-stderr.txt b/Tests/RunCMake/Syntax/NameWithNewline-stderr.txt
new file mode 100644
index 0000000..5cc111b
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithNewline-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at NameWithNewline.cmake:1 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/NameWithNewline.cmake:1
+
+  when parsing string
+
+    \${var\\nwith\\nnewline}
+
+  syntax error, unexpected cal_SYMBOL, expecting } \(7\)
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithNewline.cmake b/Tests/RunCMake/Syntax/NameWithNewline.cmake
new file mode 100644
index 0000000..583bcb0
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithNewline.cmake
@@ -0,0 +1 @@
+message(${var\nwith\nnewline})
diff --git a/Tests/RunCMake/Syntax/NameWithNewlineQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithNewlineQuoted-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithNewlineQuoted-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/NameWithNewlineQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithNewlineQuoted-stderr.txt
new file mode 100644
index 0000000..0067c2f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithNewlineQuoted-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at NameWithNewlineQuoted.cmake:1 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/NameWithNewlineQuoted.cmake:1
+
+  when parsing string
+
+    \${var\\nwith\\nnewline}
+
+  syntax error, unexpected cal_SYMBOL, expecting } \(7\)
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithNewlineQuoted.cmake b/Tests/RunCMake/Syntax/NameWithNewlineQuoted.cmake
new file mode 100644
index 0000000..da6d2cf
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithNewlineQuoted.cmake
@@ -0,0 +1 @@
+message("${var\nwith\nnewline}")
diff --git a/Tests/RunCMake/Syntax/NameWithSpaces-result.txt b/Tests/RunCMake/Syntax/NameWithSpaces-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithSpaces-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt b/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt
new file mode 100644
index 0000000..04bc226
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithSpaces-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at NameWithSpaces.cmake:1 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/NameWithSpaces.cmake:1
+
+  when parsing string
+
+    \${var
+
+  syntax error, unexpected \$end, expecting } \(5\)
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithSpaces.cmake b/Tests/RunCMake/Syntax/NameWithSpaces.cmake
new file mode 100644
index 0000000..01febe9
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithSpaces.cmake
@@ -0,0 +1 @@
+message(${var with space})
diff --git a/Tests/RunCMake/Syntax/NameWithSpacesQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithSpacesQuoted-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithSpacesQuoted-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt
new file mode 100644
index 0000000..66cf9a2
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithSpacesQuoted-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at NameWithSpacesQuoted.cmake:1 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/NameWithSpacesQuoted.cmake:1
+
+  when parsing string
+
+    \${var with space}
+
+  syntax error, unexpected cal_SYMBOL, expecting } \(17\)
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithSpacesQuoted.cmake b/Tests/RunCMake/Syntax/NameWithSpacesQuoted.cmake
new file mode 100644
index 0000000..3fba53f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithSpacesQuoted.cmake
@@ -0,0 +1 @@
+message("${var with space}")
diff --git a/Tests/RunCMake/Syntax/NameWithTabs-result.txt b/Tests/RunCMake/Syntax/NameWithTabs-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithTabs-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt b/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt
new file mode 100644
index 0000000..e888096
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithTabs-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at NameWithTabs.cmake:1 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/NameWithTabs.cmake:1
+
+  when parsing string
+
+    \${var
+
+  syntax error, unexpected \$end, expecting } \(5\)
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithTabs.cmake b/Tests/RunCMake/Syntax/NameWithTabs.cmake
new file mode 100644
index 0000000..c3b1bea
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithTabs.cmake
@@ -0,0 +1 @@
+message(${var	with	tab})
diff --git a/Tests/RunCMake/Syntax/NameWithTabsQuoted-result.txt b/Tests/RunCMake/Syntax/NameWithTabsQuoted-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithTabsQuoted-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt b/Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt
new file mode 100644
index 0000000..b020074
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithTabsQuoted-stderr.txt
@@ -0,0 +1,12 @@
+^CMake Error at NameWithTabsQuoted.cmake:1 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/NameWithTabsQuoted.cmake:1
+
+  when parsing string
+
+    \${var	with	tab}
+
+  syntax error, unexpected cal_SYMBOL, expecting } \(15\)
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/Syntax/NameWithTabsQuoted.cmake b/Tests/RunCMake/Syntax/NameWithTabsQuoted.cmake
new file mode 100644
index 0000000..8ddb85d
--- /dev/null
+++ b/Tests/RunCMake/Syntax/NameWithTabsQuoted.cmake
@@ -0,0 +1 @@
+message("${var	with	tab}")
diff --git a/Tests/RunCMake/Syntax/ParenInVarName0-result.txt b/Tests/RunCMake/Syntax/ParenInVarName0-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ParenInVarName0-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt b/Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt
new file mode 100644
index 0000000..0a6b60f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ParenInVarName0-stderr.txt
@@ -0,0 +1,12 @@
+CMake Error at ParenInVarName0.cmake:4 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/ParenInVarName0.cmake:4
+
+  when parsing string
+
+    -->\${e\(x\)}<--
+
+  Invalid character \('\('\) in a variable name: 'e'
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/ParenInVarName0.cmake b/Tests/RunCMake/Syntax/ParenInVarName0.cmake
new file mode 100644
index 0000000..f863d20
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ParenInVarName0.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0053 NEW)
+
+set("e(x)" value)
+message("-->${e(x)}<--")
diff --git a/Tests/RunCMake/Syntax/ParenInVarName1-result.txt b/Tests/RunCMake/Syntax/ParenInVarName1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ParenInVarName1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt b/Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt
new file mode 100644
index 0000000..81b1717
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ParenInVarName1-stderr.txt
@@ -0,0 +1,12 @@
+CMake Error at ParenInVarName1.cmake:4 \(message\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/ParenInVarName1.cmake:4
+
+  when parsing string
+
+    -->\${e\(x\)}<--
+
+  syntax error, unexpected cal_SYMBOL, expecting } \(10\)
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/ParenInVarName1.cmake b/Tests/RunCMake/Syntax/ParenInVarName1.cmake
new file mode 100644
index 0000000..9fdc87b
--- /dev/null
+++ b/Tests/RunCMake/Syntax/ParenInVarName1.cmake
@@ -0,0 +1,4 @@
+cmake_policy(SET CMP0053 OLD)
+
+set("{e(x)}" value)
+message("-->${e(x)}<--")
diff --git a/Tests/RunCMake/Syntax/RunCMakeTest.cmake b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
index dcabd8a..cecd338 100644
--- a/Tests/RunCMake/Syntax/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Syntax/RunCMakeTest.cmake
@@ -5,6 +5,14 @@ run_cmake(BOM-UTF-16-LE)
 run_cmake(BOM-UTF-16-BE)
 run_cmake(BOM-UTF-32-LE)
 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)
+run_cmake(CMP0053-ParenInQuotedENV)
 run_cmake(CommandSpaces)
 run_cmake(CommandTabs)
 run_cmake(CommandNewlines)
@@ -25,6 +33,7 @@ run_cmake(StringNoSpace)
 run_cmake(OneLetter)
 run_cmake(Unquoted0)
 run_cmake(Unquoted1)
+run_cmake(Unquoted2)
 run_cmake(Bracket0)
 run_cmake(Bracket1)
 run_cmake(Bracket2)
@@ -43,12 +52,20 @@ run_cmake(BracketNoSpace3)
 run_cmake(BracketNoSpace4)
 run_cmake(BracketNoSpace5)
 run_cmake(Escape1)
+run_cmake(Escape2)
+run_cmake(EscapeCharsAllowed)
+include("${RunCMake_SOURCE_DIR}/EscapeCharsDisallowed.cmake")
 run_cmake(ParenNoSpace0)
 run_cmake(ParenNoSpace1)
 run_cmake(ParenNoSpace2)
+run_cmake(ParenInVarName0)
+run_cmake(ParenInVarName1)
 run_cmake(UnterminatedCall1)
 run_cmake(UnterminatedCall2)
 run_cmake(UnterminatedString)
+run_cmake(UnterminatedBrace0)
+run_cmake(UnterminatedBrace1)
+run_cmake(UnterminatedBrace2)
 run_cmake(UnterminatedBracket0)
 run_cmake(UnterminatedBracket1)
 run_cmake(UnterminatedBracketComment)
@@ -65,3 +82,29 @@ run_cmake(AtWithVariableFile)
 run_cmake(AtWithVariableAtOnlyFile)
 run_cmake(ParenInENV)
 run_cmake(ParenInQuotedENV)
+
+# Variable name tests
+run_cmake(NameWithSpaces)
+run_cmake(NameWithTabs)
+run_cmake(NameWithNewline)
+run_cmake(NameWithCarriageReturn)
+run_cmake(NameWithEscapedSpaces)
+run_cmake(NameWithEscapedTabs)
+run_cmake(NameWithSpacesQuoted)
+run_cmake(NameWithTabsQuoted)
+run_cmake(NameWithNewlineQuoted)
+run_cmake(NameWithCarriageReturnQuoted)
+run_cmake(NameWithEscapedSpacesQuoted)
+run_cmake(NameWithEscapedTabsQuoted)
+run_cmake(CMP0053-NameWithSpaces)
+run_cmake(CMP0053-NameWithTabs)
+run_cmake(CMP0053-NameWithNewline)
+run_cmake(CMP0053-NameWithCarriageReturn)
+run_cmake(CMP0053-NameWithEscapedSpaces)
+run_cmake(CMP0053-NameWithEscapedTabs)
+run_cmake(CMP0053-NameWithSpacesQuoted)
+run_cmake(CMP0053-NameWithTabsQuoted)
+run_cmake(CMP0053-NameWithNewlineQuoted)
+run_cmake(CMP0053-NameWithCarriageReturnQuoted)
+run_cmake(CMP0053-NameWithEscapedSpacesQuoted)
+run_cmake(CMP0053-NameWithEscapedTabsQuoted)
diff --git a/Tests/RunCMake/Syntax/Unquoted2-stderr.txt b/Tests/RunCMake/Syntax/Unquoted2-stderr.txt
new file mode 100644
index 0000000..eb8883e
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Unquoted2-stderr.txt
@@ -0,0 +1 @@
+^\[\[UnquotedBracketArgument1\]\]$
diff --git a/Tests/RunCMake/Syntax/Unquoted2.cmake b/Tests/RunCMake/Syntax/Unquoted2.cmake
new file mode 100644
index 0000000..d94057d
--- /dev/null
+++ b/Tests/RunCMake/Syntax/Unquoted2.cmake
@@ -0,0 +1,3 @@
+cmake_policy(SET CMP0053 NEW)
+
+message(\[[Unquoted Bracket Argument 1]])
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt b/Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace0-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt
new file mode 100644
index 0000000..1e0ce49
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace0-stderr.txt
@@ -0,0 +1,12 @@
+CMake Error at UnterminatedBrace0.cmake:2 \(set\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake:2
+
+  when parsing string
+
+    \${
+
+  syntax error, unexpected \$end, expecting } \(2\)
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake
new file mode 100644
index 0000000..0da1290
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace0.cmake
@@ -0,0 +1,2 @@
+cmake_minimum_required(VERSION 3.0)
+set(var "${")
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
new file mode 100644
index 0000000..4e3c2b5
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace1-stderr.txt
@@ -0,0 +1,13 @@
+CMake Warning \(dev\) at UnterminatedBrace1.cmake:3 \(set\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake:3
+
+  when parsing string
+
+    \${
+
+  syntax error, unexpected \$end, expecting } \(2\)
+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/UnterminatedBrace1.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake
new file mode 100644
index 0000000..93fba34
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace1.cmake
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.0)
+cmake_policy(SET CMP0010 OLD)
+set(var "${")
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace2-result.txt b/Tests/RunCMake/Syntax/UnterminatedBrace2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt b/Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt
new file mode 100644
index 0000000..b332d34
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace2-stderr.txt
@@ -0,0 +1,12 @@
+CMake Error at UnterminatedBrace2.cmake:4 \(set\):
+  Syntax error in cmake code at
+
+    .*/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake:4
+
+  when parsing string
+
+    \${
+
+  There is an unterminated variable reference.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake b/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake
new file mode 100644
index 0000000..a650e5b
--- /dev/null
+++ b/Tests/RunCMake/Syntax/UnterminatedBrace2.cmake
@@ -0,0 +1,4 @@
+cmake_minimum_required(VERSION 3.0)
+cmake_policy(SET CMP0010 OLD)
+cmake_policy(SET CMP0053 NEW)
+set(var "${")
diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt
index be6d8fe..4fa5a86 100644
--- a/Tests/StringFileTest/CMakeLists.txt
+++ b/Tests/StringFileTest/CMakeLists.txt
@@ -127,12 +127,6 @@ string(LENGTH ${substringres} lengthres)
 
 file(RELATIVE_PATH relpath "/usr/local/bin" "/usr/X11R6/bin/xnest")
 
-# Escaping test
-set(var "\\ \" \  \t \n \r \# \( \) \0")
-message("Output: [${var}]")
-set(var \\ \" \  \t \n \r \# \( \) \0)
-message("Output: [${var}]")
-
 # Make-style unquoted argument test
 set(var $(VAR1)$(VAR2)/$(VAR3))
 message("Output: [${var}]")
@@ -141,13 +135,6 @@ if(NOT result)
   message(SEND_ERROR "Unquoted $(VAR) syntax is broken.")
 endif()
 
-# Obscure environment variable name
-set("ENV{x+(y)}" "Obscure environment variable value")
-message("Output: [$ENV{x+(y)}]")
-if(NOT "$ENV{x+(y)}" STREQUAL "Obscure environment variable value")
-  message(SEND_ERROR "Environment variable \"ENV{x+(y)}\" does not work.")
-endif()
-
 # Make directories test
 file(MAKE_DIRECTORY
   "${CMAKE_CURRENT_BINARY_DIR}/Includes"

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bc3856586388a610ef3d06d51c212a9ed25856c4
commit bc3856586388a610ef3d06d51c212a9ed25856c4
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri Feb 7 22:37:54 2014 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu May 8 13:24:49 2014 -0400

    EVIS: Reimplement using custom parsing code
    
    Introduce a new implementation of ExpandVariablesInString and select
    between the old and new implementations based on policy CMP0053.
    Instead of cmCommandArgumentParserHelper, use a custom parser with our
    own stack.  This is much faster and works well for our simple grammar.
    
    The new behavior of CMP0053 should expand @VAR@ syntax only in certain
    contexts.  All existing EVIS callers use "replaceAt == true" so
    hard-code our call to the old implementation.  Update the signature to
    default to "replaceAt == false" and pass "replaceAt == true" explicitly
    in the call sites for configure_file and string(CONFIGURE).
    
    Testing the configure (no generate) step with ParaView shows ~20%
    performance improvement.
    
    In terms of complete configure/generate steps, further testing with
    ParaView shows a 20% performance improvement over 2.8.12.2 with Unix
    Makefiles and minimal with Ninja. Ninja is less because it generate step
    is the expensive part (future work will address this) by a long shot and
    these changes help the configure step for the most part.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 53e1764..29d2fb0 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -161,6 +161,7 @@ void cmMakefile::Initialize()
   this->cmDefineRegex.compile("#cmakedefine[ \t]+([A-Za-z_0-9]*)");
   this->cmDefine01Regex.compile("#cmakedefine01[ \t]+([A-Za-z_0-9]*)");
   this->cmAtVarRegex.compile("(@[A-Za-z_0-9/.+-]+@)");
+  this->cmNamedCurly.compile("^[A-Za-z0-9/_.+-]+{");
 
   // Enter a policy level for this directory.
   this->PushPolicy();
@@ -2540,23 +2541,129 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
                                                 bool removeEmpty,
                                                 bool replaceAt) const
 {
-  if ( source.empty() || source.find_first_of("$@\\") == source.npos)
+  bool compareResults = false;
+  cmake::MessageType mtype = cmake::LOG;
+  std::string errorstr;
+  std::string original;
+
+  // Sanity check the @ONLY mode.
+  if(atOnly && (!noEscapes || !removeEmpty))
     {
+    // This case should never be called.  At-only is for
+    // configure-file/string which always does no escapes.
+    this->IssueMessage(cmake::INTERNAL_ERROR,
+                       "ExpandVariablesInString @ONLY called "
+                       "on something with escapes.");
     return source.c_str();
     }
 
-  // Special-case the @ONLY mode.
-  if(atOnly)
+  // Variables used in the WARN case.
+  std::string newResult;
+  std::string newErrorstr;
+  cmake::MessageType newError = cmake::LOG;
+
+  switch(this->GetPolicyStatus(cmPolicies::CMP0053))
     {
-    if(!noEscapes || !removeEmpty || !replaceAt)
+    case cmPolicies::WARN:
       {
-      // This case should never be called.  At-only is for
-      // configure-file/string which always does no escapes.
-      this->IssueMessage(cmake::INTERNAL_ERROR,
-                         "ExpandVariablesInString @ONLY called "
-                         "on something with escapes.");
+      // Save the original string for the warning.
+      original = source;
+      newResult = source;
+      compareResults = true;
+      newError =
+        ExpandVariablesInStringNew(newErrorstr, newResult, escapeQuotes,
+                                   noEscapes, atOnly, filename, line,
+                                   removeEmpty, replaceAt);
       }
+    case cmPolicies::OLD:
+      mtype = ExpandVariablesInStringOld(errorstr, source, escapeQuotes,
+                                         noEscapes, atOnly, filename,
+                                         line, removeEmpty, true);
+      break;
+    case cmPolicies::REQUIRED_IF_USED:
+    case cmPolicies::REQUIRED_ALWAYS:
+      // Messaging here would be *very* verbose.
+    case cmPolicies::NEW:
+      mtype = ExpandVariablesInStringNew(errorstr, source, escapeQuotes,
+                                         noEscapes, atOnly, filename,
+                                         line, removeEmpty, replaceAt);
+      break;
+    }
 
+  // If it's an error in either case, just report the error...
+  if(mtype != cmake::LOG)
+    {
+    if(mtype == cmake::FATAL_ERROR)
+      {
+      cmSystemTools::SetFatalErrorOccured();
+      }
+    this->IssueMessage(mtype, errorstr);
+    }
+  // ...otherwise, see if there's a difference that needs to be warned about.
+  else if(compareResults && (newResult != source || newError != mtype))
+    {
+    std::string msg =
+      this->GetPolicies()->GetPolicyWarning(cmPolicies::CMP0053);
+    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)
+      {
+      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
+      {
+      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";
+      }
+
+    msg +=
+      "Using the old result for compatibility since the policy is not set.";
+
+    this->IssueMessage(cmake::AUTHOR_WARNING, msg);
+    }
+
+  return source.c_str();
+}
+
+cmake::MessageType cmMakefile::ExpandVariablesInStringOld(
+                                                std::string& errorstr,
+                                                std::string& source,
+                                                bool escapeQuotes,
+                                                bool noEscapes,
+                                                bool atOnly,
+                                                const char* filename,
+                                                long line,
+                                                bool removeEmpty,
+                                                bool replaceAt) const
+{
+  // Fast path strings without any special characters.
+  if ( source.find_first_of("$@\\") == source.npos)
+    {
+    return cmake::LOG;
+    }
+
+  // Special-case the @ONLY mode.
+  if(atOnly)
+    {
     // Store an original copy of the input.
     std::string input = source;
 
@@ -2596,7 +2703,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
     // Append the rest of the unchanged part of the string.
     source.append(in);
 
-    return source.c_str();
+    return cmake::LOG;
     }
 
   // This method replaces ${VAR} and @VAR@ where VAR is looked up
@@ -2613,6 +2720,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
   parser.SetRemoveEmpty(removeEmpty);
   int res = parser.ParseString(source.c_str(), 0);
   const char* emsg = parser.GetError();
+  cmake::MessageType mtype = cmake::LOG;
   if ( res && !emsg[0] )
     {
     source = parser.GetResult();
@@ -2639,7 +2747,7 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
     // parser reported an error message without failing because the
     // helper implementation is unhappy, which has always reported an
     // error.
-    cmake::MessageType mtype = cmake::FATAL_ERROR;
+    mtype = cmake::FATAL_ERROR;
     if(!res)
       {
       // This is a real argument parsing error.  Use policy CMP0010 to
@@ -2661,13 +2769,334 @@ const char *cmMakefile::ExpandVariablesInString(std::string& source,
                     ->GetRequiredPolicyError(cmPolicies::CMP0010));
         case cmPolicies::NEW:
           // NEW behavior is to report the error.
-          cmSystemTools::SetFatalErrorOccured();
           break;
         }
       }
-    this->IssueMessage(mtype, error.str());
+    errorstr = error.str();
     }
-  return source.c_str();
+  return mtype;
+}
+
+typedef enum
+  {
+  NORMAL,
+  ENVIRONMENT,
+  CACHE
+  } t_domain;
+struct t_lookup
+  {
+  t_lookup(): domain(NORMAL), loc(0) {}
+  t_domain domain;
+  size_t loc;
+  };
+
+cmake::MessageType cmMakefile::ExpandVariablesInStringNew(
+                                            std::string& errorstr,
+                                            std::string& source,
+                                            bool escapeQuotes,
+                                            bool noEscapes,
+                                            bool atOnly,
+                                            const char* filename,
+                                            long line,
+                                            bool removeEmpty,
+                                            bool replaceAt) const
+{
+  // This method replaces ${VAR} and @VAR@ where VAR is looked up
+  // with GetDefinition(), if not found in the map, nothing is expanded.
+  // It also supports the $ENV{VAR} syntax where VAR is looked up in
+  // the current environment variables.
+
+  const char* in = source.c_str();
+  const char* last = in;
+  std::string result;
+  result.reserve(source.size());
+  std::stack<t_lookup> openstack;
+  bool error = false;
+  bool done = false;
+  openstack.push(t_lookup());
+  cmake::MessageType mtype = cmake::LOG;
+
+  do
+    {
+    char inc = *in;
+    switch(inc)
+      {
+      case '}':
+        if(openstack.size() > 1)
+          {
+          t_lookup var = openstack.top();
+          openstack.pop();
+          result.append(last, in - last);
+          std::string const& lookup = result.substr(var.loc);
+          const char* value = NULL;
+          std::string varresult;
+          static const std::string lineVar = "CMAKE_CURRENT_LIST_LINE";
+          switch(var.domain)
+            {
+            case NORMAL:
+              if(filename && lookup == lineVar)
+                {
+                cmOStringStream ostr;
+                ostr << line;
+                varresult = ostr.str();
+                }
+              else
+                {
+                value = this->GetDefinition(lookup);
+                }
+              break;
+            case ENVIRONMENT:
+              value = cmSystemTools::GetEnv(lookup.c_str());
+              break;
+            case CACHE:
+              value = this->GetCacheManager()->GetCacheValue(lookup);
+              break;
+            }
+          // Get the string we're meant to append to.
+          if(value)
+            {
+            if(escapeQuotes)
+              {
+              varresult = cmSystemTools::EscapeQuotes(value);
+              }
+            else
+              {
+              varresult = value;
+              }
+            }
+          else if(!removeEmpty)
+            {
+            // check to see if we need to print a warning
+            // if strict mode is on and the variable has
+            // not been "cleared"/initialized with a set(foo ) call
+            if(this->GetCMakeInstance()->GetWarnUninitialized() &&
+               !this->VariableInitialized(lookup))
+              {
+              if (this->CheckSystemVars ||
+                  cmSystemTools::IsSubDirectory(filename,
+                                                this->GetHomeDirectory()) ||
+                  cmSystemTools::IsSubDirectory(filename,
+                                             this->GetHomeOutputDirectory()))
+                {
+                cmOStringStream msg;
+                cmListFileBacktrace bt;
+                cmListFileContext lfc;
+                lfc.FilePath = filename;
+                lfc.Line = line;
+                bt.push_back(lfc);
+                msg << "uninitialized variable \'" << lookup << "\'";
+                this->GetCMakeInstance()->IssueMessage(cmake::AUTHOR_WARNING,
+                                                       msg.str().c_str(), bt);
+                }
+              }
+            }
+          result.replace(var.loc, result.size() - var.loc, varresult);
+          // Start looking from here on out.
+          last = in + 1;
+          }
+        break;
+      case '$':
+        if(!atOnly)
+          {
+          t_lookup lookup;
+          const char* next = in + 1;
+          const char* start = NULL;
+          char nextc = *next;
+          if(nextc == '{')
+            {
+            // Looking for a variable.
+            start = in + 2;
+            lookup.domain = NORMAL;
+            }
+          else if(nextc == '<')
+            {
+            }
+          else if(!nextc)
+            {
+            result.append(last, next - last);
+            last = next;
+            }
+          else if(cmHasLiteralPrefix(next, "ENV{"))
+            {
+            // Looking for an environment variable.
+            start = in + 5;
+            lookup.domain = ENVIRONMENT;
+            }
+          else if(cmHasLiteralPrefix(next, "CACHE{"))
+            {
+            // Looking for a cache variable.
+            start = in + 7;
+            lookup.domain = CACHE;
+            }
+          else
+            {
+            if(this->cmNamedCurly.find(next))
+              {
+              errorstr = "Syntax $"
+                  + std::string(next, this->cmNamedCurly.end())
+                  + "{} is not supported.  Only ${}, $ENV{}, "
+                    "and $CACHE{} are allowed.";
+              mtype = cmake::FATAL_ERROR;
+              error = true;
+              }
+            }
+          if(start)
+            {
+            result.append(last, in - last);
+            last = start;
+            in = start - 1;
+            lookup.loc = result.size();
+            openstack.push(lookup);
+            }
+          break;
+          }
+      case '\\':
+        if(!noEscapes)
+          {
+          const char* next = in + 1;
+          char nextc = *next;
+          if(nextc == 't')
+            {
+            result.append(last, in - last);
+            result.append("\t");
+            last = next + 1;
+            }
+          else if(nextc == 'n')
+            {
+            result.append(last, in - last);
+            result.append("\n");
+            last = next + 1;
+            }
+          else if(nextc == 'r')
+            {
+            result.append(last, in - last);
+            result.append("\r");
+            last = next + 1;
+            }
+          else if(nextc == ';' && openstack.size() == 1)
+            {
+            // Handled in ExpandListArgument; pass the backslash literally.
+            }
+          else if (isalnum(nextc) || nextc == '\0')
+            {
+            errorstr += "Invalid character escape '\\";
+            if (nextc)
+              {
+              errorstr += nextc;
+              errorstr += "'.";
+              }
+            else
+              {
+              errorstr += "' (at end of input).";
+              }
+            error = true;
+            }
+          else
+            {
+            // Take what we've found so far, skipping the escape character.
+            result.append(last, in - last);
+            // Start tracking from the next character.
+            last = in + 1;
+            }
+          // Skip the next character since it was escaped, but don't read past
+          // the end of the string.
+          if(*last)
+            {
+            ++in;
+            }
+          }
+        break;
+      case '\n':
+        // Onto the next line.
+        ++line;
+        break;
+      case '\0':
+        done = true;
+        break;
+      case '@':
+        if(replaceAt)
+          {
+          const char* nextAt = strchr(in + 1, '@');
+          if(nextAt && nextAt != in + 1 &&
+             nextAt == in + 1 + strspn(in + 1,
+                "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+                "abcdefghijklmnopqrstuvwxyz"
+                "0123456789/_.+-"))
+            {
+            std::string variable(in + 1, nextAt - in - 1);
+            std::string varresult = this->GetSafeDefinition(variable);
+            if(escapeQuotes)
+              {
+              varresult = cmSystemTools::EscapeQuotes(varresult);
+              }
+            // Skip over the variable.
+            result.append(last, in - last);
+            result.append(varresult);
+            in = nextAt;
+            last = in + 1;
+            break;
+            }
+          }
+        // Failed to find a valid @ expansion; treat it as literal.
+        /* FALLTHROUGH */
+      default:
+        {
+        if(openstack.size() > 1 &&
+           !(isalnum(inc) || inc == '_' ||
+             inc == '/' || inc == '.' ||
+             inc == '+' || inc == '-'))
+          {
+          errorstr += "Invalid character (\'";
+          errorstr += inc;
+          result.append(last, in - last);
+          errorstr += "\') in a variable name: "
+                      "'" + result.substr(openstack.top().loc) + "'";
+          mtype = cmake::FATAL_ERROR;
+          error = true;
+          }
+        break;
+        }
+      }
+    // Look at the next character.
+    } while(!error && !done && *++in);
+
+  // Check for open variable references yet.
+  if(!error && openstack.size() != 1)
+    {
+    // There's an open variable reference waiting.  Policy CMP0010 flags
+    // whether this is an error or not.  The new parser now enforces
+    // CMP0010 as well.
+    errorstr += "There is an unterminated variable reference.";
+    error = true;
+    }
+
+  if(error)
+    {
+    cmOStringStream emsg;
+    emsg << "Syntax error in cmake code ";
+    if(filename)
+      {
+      // This filename and line number may be more specific than the
+      // command context because one command invocation can have
+      // arguments on multiple lines.
+      emsg << "at\n"
+            << "  " << filename << ":" << line << "\n";
+      }
+    emsg << "when parsing string\n"
+         << "  " << source << "\n";
+    emsg << errorstr;
+    mtype = cmake::FATAL_ERROR;
+    errorstr = emsg.str();
+    }
+  else
+    {
+    // Append the rest of the unchanged part of the string.
+    result.append(last);
+
+    source = result;
+    }
+
+  return mtype;
 }
 
 void cmMakefile::RemoveVariablesInString(std::string& source,
@@ -2890,7 +3319,7 @@ bool cmMakefile::ExpandArguments(
     value = i->Value;
     this->ExpandVariablesInString(value, false, false, false,
                                   i->FilePath, i->Line,
-                                  false, true);
+                                  false, false);
 
     // If the argument is quoted, it should be one argument.
     // Otherwise, it may be a list of arguments.
@@ -3451,7 +3880,7 @@ void cmMakefile::ConfigureString(const std::string& input,
 
   // Perform variable replacements.
   this->ExpandVariablesInString(output, escapeQuotes, true,
-                                atOnly, 0, -1, true);
+                                atOnly, 0, -1, true, true);
 }
 
 int cmMakefile::ConfigureFile(const char* infile, const char* outfile,
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index ac00771..2bfd19b 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -679,7 +679,7 @@ public:
                                       const char* filename = 0,
                                       long line = -1,
                                       bool removeEmpty = false,
-                                      bool replaceAt = true) const;
+                                      bool replaceAt = false) const;
 
   /**
    * Remove any remaining variables in the string. Anything with ${var} or
@@ -994,6 +994,7 @@ private:
   mutable cmsys::RegularExpression cmDefineRegex;
   mutable cmsys::RegularExpression cmDefine01Regex;
   mutable cmsys::RegularExpression cmAtVarRegex;
+  mutable cmsys::RegularExpression cmNamedCurly;
 
   cmPropertyMap Properties;
 
@@ -1050,6 +1051,28 @@ private:
   // Enforce rules about CMakeLists.txt files.
   void EnforceDirectoryLevelRules() const;
 
+  // CMP0053 == old
+  cmake::MessageType ExpandVariablesInStringOld(
+                                  std::string& errorstr,
+                                  std::string& source,
+                                  bool escapeQuotes,
+                                  bool noEscapes,
+                                  bool atOnly,
+                                  const char* filename,
+                                  long line,
+                                  bool removeEmpty,
+                                  bool replaceAt) const;
+  // CMP0053 == new
+  cmake::MessageType ExpandVariablesInStringNew(
+                                  std::string& errorstr,
+                                  std::string& source,
+                                  bool escapeQuotes,
+                                  bool noEscapes,
+                                  bool atOnly,
+                                  const char* filename,
+                                  long line,
+                                  bool removeEmpty,
+                                  bool replaceAt) const;
   bool GeneratingBuildSystem;
   /**
    * Old version of GetSourceFileWithOutput(const std::string&) kept for

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=25102efc1db1e0d165ebe5e4eaef33b8206d9d3e
commit 25102efc1db1e0d165ebe5e4eaef33b8206d9d3e
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Mon Apr 28 14:59:11 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu May 8 13:24:49 2014 -0400

    EVIS: Add policy CMP0053
    
    This policy switches between the old EVIS parser and the new, faster
    parser.

diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst
index 4b895fe..136cf5c 100644
--- a/Help/manual/cmake-policies.7.rst
+++ b/Help/manual/cmake-policies.7.rst
@@ -104,3 +104,4 @@ All Policies
    /policy/CMP0050
    /policy/CMP0051
    /policy/CMP0052
+   /policy/CMP0053
diff --git a/Help/policy/CMP0010.rst b/Help/policy/CMP0010.rst
index 01699e1..9d2eb76 100644
--- a/Help/policy/CMP0010.rst
+++ b/Help/policy/CMP0010.rst
@@ -10,6 +10,9 @@ variable reference is an error.  The OLD behavior for this policy is
 to warn about the error, leave the string untouched, and continue.
 The NEW behavior for this policy is to report an error.
 
+If :policy:`CMP0053` is set to ``NEW``, this policy has no effect
+and is treated as always being ``NEW``.
+
 This policy was introduced in CMake version 2.6.3.  CMake version
 |release| warns when the policy is not set and uses OLD behavior.  Use
 the cmake_policy command to set it to OLD or NEW explicitly.
diff --git a/Help/policy/CMP0053.rst b/Help/policy/CMP0053.rst
new file mode 100644
index 0000000..fac430e
--- /dev/null
+++ b/Help/policy/CMP0053.rst
@@ -0,0 +1,44 @@
+CMP0053
+-------
+
+Simplify variable reference and escape sequence evaluation.
+
+CMake 3.1 introduced a much faster implementation of evaluation of the
+:ref:`Variable References` and :ref:`Escape Sequences` documented in the
+:manual:`cmake-language(7)` manual.  While the behavior is identical
+to the legacy implementation in most cases, some corner cases were
+cleaned up to simplify the behavior.  Specifically:
+
+* Expansion of ``@VAR@`` reference syntax defined by the
+  :command:`configure_file` and :command:`string(CONFIGURE)`
+  commands is no longer performed in other contexts.
+
+* Literal ``${VAR}`` reference syntax may contain only
+  alphanumeric characters (``A-Z``, ``a-z``, ``0-9``) and
+  the characters ``_``, ``.``, ``/``, ``-``, and ``+``.
+  Variables with other characters in their name may still
+  be referenced indirectly, e.g.
+
+  .. code-block:: cmake
+
+    set(varname "otherwise & disallowed $ characters")
+    message("${${varname}}")
+
+* The setting of policy :policy:`CMP0010` is not considered,
+  so improper variable reference syntax is always an error.
+
+* More characters are allowed to be escaped in variable names.
+  Previously, only ``()#" \#@^`` were valid characters to
+  escape. Now any non-alphanumeric, non-semicolon, non-NUL
+  character may be escaped following the ``escape_identity``
+  production in the :ref:`Escape Sequences` section of the
+  :manual:`cmake-language(7)` manual.
+
+The ``OLD`` behavior for this policy is to honor the legacy behavior for
+variable references and escape sequences.  The ``NEW`` behavior is to
+use the simpler variable expansion and escape sequence evaluation rules.
+
+This policy was introduced in CMake version 3.1.
+CMake version |release| warns when the policy is not set and uses
+``OLD`` behavior.  Use the :command:`cmake_policy` command to set
+it to ``OLD`` or ``NEW`` explicitly.
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 309f280..693945d 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -354,6 +354,11 @@ cmPolicies::cmPolicies()
     "Reject source and build dirs in installed "
     "INTERFACE_INCLUDE_DIRECTORIES.",
     3,1,0, cmPolicies::WARN);
+
+  this->DefinePolicy(
+    CMP0053, "CMP0053",
+    "Simplify variable reference and escape sequence evaluation.",
+    3,1,0, cmPolicies::WARN);
 }
 
 cmPolicies::~cmPolicies()
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 60f35c2..5d69d14 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -108,6 +108,8 @@ public:
     CMP0052, ///< Reject source and build dirs in installed
     /// INTERFACE_INCLUDE_DIRECTORIES
 
+    CMP0053, ///< Simplify variable reference and escape sequence evaluation
+
     /** \brief Always the last entry.
      *
      * Useful mostly to avoid adding a comma the last policy when adding a new

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e423f1c05d6d11483deb7acd135623df8de45655
commit e423f1c05d6d11483deb7acd135623df8de45655
Author:     Ben Boeckel <ben.boeckel at kitware.com>
AuthorDate: Fri May 2 15:44:43 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu May 8 13:24:49 2014 -0400

    Windows: Avoid () in environment variable references
    
    Use nested variable evaluation instead.

diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 307aafc..5c439e9 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -157,7 +157,8 @@ if(MSVC)
         "${msvc_install_dir}/../../VC/redist"
         "${base_dir}/VC/redist"
         "$ENV{ProgramFiles}/Microsoft Visual Studio ${v}.0/VC/redist"
-        "$ENV{ProgramFiles(x86)}/Microsoft Visual Studio ${v}.0/VC/redist"
+        set(programfilesx86 "ProgramFiles(x86)")
+        "$ENV{${programfilesx86}}/Microsoft Visual Studio ${v}.0/VC/redist"
       )
     mark_as_advanced(MSVC${v}_REDIST_DIR)
     set(MSVC${v}_CRT_DIR "${MSVC${v}_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC${v}0.CRT")
diff --git a/Modules/Platform/WindowsPaths.cmake b/Modules/Platform/WindowsPaths.cmake
index 3240c23..658de3b 100644
--- a/Modules/Platform/WindowsPaths.cmake
+++ b/Modules/Platform/WindowsPaths.cmake
@@ -56,9 +56,10 @@ else()
   if(DEFINED "ENV{ProgramFiles}")
     list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles}")
   endif()
-  if(DEFINED "ENV{ProgramFiles(x86)}")
+  set(programfilesx86 "ProgramFiles(x86)")
+  if(DEFINED "ENV{${programfilesx86}}")
     # 64-bit binary.  32-bit program files are in ProgramFiles(x86).
-    list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{ProgramFiles(x86)}")
+    list(APPEND CMAKE_SYSTEM_PREFIX_PATH "$ENV{${programfilesx86}}")
   elseif(DEFINED "ENV{SystemDrive}")
     # Guess the 32-bit program files location.
     if(EXISTS "$ENV{SystemDrive}/Program Files (x86)")

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c179b2898eb507c0e4e169665d8698f1efb05f16
commit c179b2898eb507c0e4e169665d8698f1efb05f16
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu May 1 10:18:03 2014 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu May 8 13:24:22 2014 -0400

    Help: Add more reference targets to cmake-language.7

diff --git a/Help/manual/cmake-language.7.rst b/Help/manual/cmake-language.7.rst
index 1e4c6c5..5bbe16e 100644
--- a/Help/manual/cmake-language.7.rst
+++ b/Help/manual/cmake-language.7.rst
@@ -287,6 +287,8 @@ For example:
  Instead use a `Quoted Argument`_ or a `Bracket Argument`_ to
  represent the content.
 
+.. _`Escape Sequences`:
+
 Escape Sequences
 ----------------
 
@@ -305,6 +307,8 @@ encodes a tab, carriage return, or newline character, respectively.
 A ``\;`` encodes itself but may be used in an `Unquoted Argument`_
 to encode the ``;`` without dividing the argument value on it.
 
+.. _`Variable References`:
+
 Variable References
 -------------------
 

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c3d98bd28994bea455a1a2ca37c2a693aa9415a7
commit c3d98bd28994bea455a1a2ca37c2a693aa9415a7
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 26 08:58:45 2014 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu May 8 13:24:22 2014 -0400

    Utilities/Release: Use ${VAR} instead of @VAR@ syntax
    
    The Utilities/Release/Cygwin/CMakeLists.txt is processed in the project,
    not configured, so we should avoid using @-replacement syntax.

diff --git a/Utilities/Release/Cygwin/CMakeLists.txt b/Utilities/Release/Cygwin/CMakeLists.txt
index c59a6fa..73a8220 100644
--- a/Utilities/Release/Cygwin/CMakeLists.txt
+++ b/Utilities/Release/Cygwin/CMakeLists.txt
@@ -14,9 +14,9 @@ message(STATUS "Using curses version: libncurses${MAX}")
 configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-setup.hint.in"
   "${CMake_BINARY_DIR}/setup.hint")
 configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/README.cygwin.in"
-  "${CMake_BINARY_DIR}/Docs/@CPACK_PACKAGE_FILE_NAME at -@CPACK_CYGWIN_PATCH_NUMBER at .README")
+  "${CMake_BINARY_DIR}/Docs/${CPACK_PACKAGE_FILE_NAME}-${CPACK_CYGWIN_PATCH_NUMBER}.README")
 install_files(/share/doc/Cygwin FILES
-  ${CMake_BINARY_DIR}/Docs/@CPACK_PACKAGE_FILE_NAME at -@CPACK_CYGWIN_PATCH_NUMBER at .README
+  ${CMake_BINARY_DIR}/Docs/${CPACK_PACKAGE_FILE_NAME}-${CPACK_CYGWIN_PATCH_NUMBER}.README
   )
 configure_file("${CMake_SOURCE_DIR}/Utilities/Release/Cygwin/cygwin-package.sh.in"
   ${CPACK_CYGWIN_BUILD_SCRIPT})

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

Summary of changes:


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list