CMP0127.rst 1.0 KB

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