CMP0053.rst 1.8 KB

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