CMP0102.rst 1.3 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. This policy was introduced in CMake version 3.17. Use the
  18. :command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly.
  19. Unlike many policies, CMake version |release| does *not* warn
  20. when this policy is not set and simply uses ``OLD`` behavior. See
  21. documentation of the :variable:`CMAKE_POLICY_WARNING_CMP0102
  22. <CMAKE_POLICY_WARNING_CMP<NNNN>>` variable to control the warning.
  23. .. include:: DEPRECATED.txt