CMP0127.rst 986 B

123456789101112131415161718192021222324252627282930313233
  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. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.22
  20. .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
  21. .. include:: STANDARD_ADVICE.txt
  22. .. include:: DEPRECATED.txt