CMP0159.rst 915 B

1234567891011121314151617181920212223
  1. CMP0159
  2. -------
  3. .. versionadded:: 3.29
  4. :command:`file(STRINGS)` with ``REGEX`` updates :variable:`CMAKE_MATCH_<n>`.
  5. In CMake 3.28 and below the :command:`file(STRINGS)` command's ``REGEX``
  6. option does not affect :variable:`CMAKE_MATCH_<n>` variables. CMake 3.29
  7. and above prefer to update the :variable:`CMAKE_MATCH_<n>` variables using
  8. captures from the last match in the file, similar to the
  9. :command:`string(REGEX MATCHALL)` command. This policy provides
  10. compatibility for projects that have not been updated to expect the behavior.
  11. The ``OLD`` behavior for this policy is for :command:`file(STRINGS)` with
  12. ``REGEX`` to not store capture groups in :variable:`CMAKE_MATCH_<n>`
  13. variables. The ``NEW`` behavior is to store the capture groups.
  14. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
  15. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
  16. .. include:: STANDARD_ADVICE.txt
  17. .. include:: DEPRECATED.txt