1CMP0053 2------- 3 4.. versionadded:: 3.1 5 6Simplify variable reference and escape sequence evaluation. 7 8CMake 3.1 introduced a much faster implementation of evaluation of the 9:ref:`Variable References` and :ref:`Escape Sequences` documented in the 10:manual:`cmake-language(7)` manual. While the behavior is identical 11to the legacy implementation in most cases, some corner cases were 12cleaned up to simplify the behavior. Specifically: 13 14* Expansion of ``@VAR@`` reference syntax defined by the 15 :command:`configure_file` and :command:`string(CONFIGURE)` 16 commands is no longer performed in other contexts. 17 18* Literal ``${VAR}`` reference syntax may contain only 19 alphanumeric characters (``A-Z``, ``a-z``, ``0-9``) and 20 the characters ``_``, ``.``, ``/``, ``-``, and ``+``. 21 Note that ``$`` is technically allowed in the ``NEW`` behavior, but is 22 invalid for ``OLD`` behavior. This is due to an oversight during the 23 implementation of :policy:`CMP0053` and its use as a literal variable 24 reference is discouraged for this reason. 25 Variables with other characters in their name may still 26 be referenced indirectly, e.g. 27 28 .. code-block:: cmake 29 30 set(varname "otherwise & disallowed $ characters") 31 message("${${varname}}") 32 33* The setting of policy :policy:`CMP0010` is not considered, 34 so improper variable reference syntax is always an error. 35 36* More characters are allowed to be escaped in variable names. 37 Previously, only ``()#" \@^`` were valid characters to 38 escape. Now any non-alphanumeric, non-semicolon, non-NUL 39 character may be escaped following the ``escape_identity`` 40 production in the :ref:`Escape Sequences` section of the 41 :manual:`cmake-language(7)` manual. 42 43The ``OLD`` behavior for this policy is to honor the legacy behavior for 44variable references and escape sequences. The ``NEW`` behavior is to 45use the simpler variable expansion and escape sequence evaluation rules. 46 47This policy was introduced in CMake version 3.1. 48CMake version |release| warns when the policy is not set and uses 49``OLD`` behavior. Use the :command:`cmake_policy` command to set 50it to ``OLD`` or ``NEW`` explicitly. 51 52.. include:: DEPRECATED.txt 53