CMP0102.rst 1.2 KB

1234567891011121314151617181920212223242526272829
  1. CMP0102
  2. -------
  3. .. versionadded:: 3.17
  4. The :command:`mark_as_advanced` command no longer creates a cache entry if one
  5. does not already exist.
  6. In CMake 3.16 and below, if a variable was not defined at all or just defined
  7. locally, the :command:`mark_as_advanced` command would create a new cache
  8. entry with an ``UNINITIALIZED`` type and no value. When a :command:`find_path`
  9. (or other similar ``find_`` command) would next run, it would find this
  10. undefined cache entry and set it up with an empty string value. This process
  11. would end up deleting the local variable in the process (due to the way the
  12. cache works), effectively clearing any stored ``find_`` results that were only
  13. available in the local scope.
  14. The ``OLD`` behavior for this policy is to create the empty cache definition.
  15. The ``NEW`` behavior of this policy is to ignore variables which do not
  16. already exist in the cache.
  17. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.17
  18. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn by default
  19. .. include:: STANDARD_ADVICE.txt
  20. See documentation of the :variable:`CMAKE_POLICY_WARNING_CMP0102
  21. <CMAKE_POLICY_WARNING_CMP<NNNN>>` variable to control the warning.
  22. .. include:: DEPRECATED.txt