CMP0127.rst 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. CMP0127
  2. -------
  3. .. versionadded:: 3.22
  4. :command:`cmake_dependent_option` supports full :ref:`Condition Syntax`.
  5. The ``<depends>`` parameter accepts a :ref:`semicolon-separated list <CMake
  6. Language Lists>` of conditions. CMake 3.21 and lower evaluates each
  7. ``condition`` as ``if(${condition})``, which does not properly handle
  8. conditions with nested paren groups. CMake 3.22 and above instead prefer
  9. to evaluate each ``condition`` as ``if(<condition>)``, where ``<condition>``
  10. is re-parsed as if literally written in a call to :command:`if`. This
  11. allows expressions like::
  12. "A AND (B OR C)"
  13. but requires expressions like::
  14. "FOO MATCHES (UPPER|lower)"
  15. to be re-written as::
  16. "FOO MATCHES \"(UPPER|lower)\""
  17. Policy ``CMP0127`` provides compatibility for projects that have not
  18. been updated to expect the new behavior.
  19. This policy was introduced in CMake version 3.22. CMake version
  20. |release| warns when the policy is not set and uses ``OLD`` behavior.
  21. Use the :command:`cmake_policy` command to set it to ``OLD`` or ``NEW``
  22. explicitly.
  23. .. include:: DEPRECATED.txt