CMP0121.rst 783 B

123456789101112131415161718192021
  1. CMP0121
  2. -------
  3. .. versionadded:: 3.21
  4. The :command:`list` command now detects invalid indices.
  5. Prior to CMake version 3.21, the :command:`list` command's ``GET``,
  6. ``INSERT``, ``SUBLIST``, and ``REMOVE_AT`` subcommands did not detect invalid
  7. index arguments.
  8. The ``OLD`` behavior of this policy is for invalid indices to be treated as
  9. their integer value (if any) at the start of the string. For example,
  10. ``2good4you`` is a ``2`` and ``not_an_integer`` is a ``0``. The ``NEW``
  11. behavior is for invalid indices to trigger an error.
  12. This policy was introduced in CMake version 3.21. CMake version |release|
  13. warns when the policy is not set and uses ``OLD`` behavior. Use the
  14. :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
  15. .. include:: DEPRECATED.txt