CMP0163.rst 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. CMP0163
  2. -------
  3. .. versionadded:: 3.30
  4. The :prop_sf:`GENERATED` source file property is now visible in all directories.
  5. In CMake 3.29 and below, the :prop_sf:`GENERATED` source file property,
  6. like other source file properties, was scoped in every directory separately.
  7. Although policy :policy:`CMP0118` allowed sources marked ``GENERATED`` in one
  8. directory to be used in other directories without manually marking them as
  9. ``GENERATED`` again, the ``GENERATED`` property was still not visible to
  10. :command:`get_property` and :command:`get_source_file_property` calls.
  11. Whether or not a source file is generated is an all-or-nothing global
  12. property of the source: a source is either generated or it is not.
  13. CMake 3.30 and above prefer to treat the :prop_sf:`GENERATED` source file
  14. property as globally scoped. Once it is set in one directory, it is
  15. immediately visible to :command:`get_property` and
  16. :command:`get_source_file_property` calls in other directories.
  17. This policy provides compatibility for projects that have not been
  18. updated for this behavior.
  19. The ``OLD`` behavior of this policy is for the ``GENERATED`` source file
  20. property to be visible only in the directories in which it is set. The
  21. ``NEW`` behavior of this policy is to allow the ``GENERATED`` source file
  22. property to be visible in all directories once set in any directory.
  23. Furthermore, the ``NEW`` behavior of this policy implies the ``NEW``
  24. behavior of policy :policy:`CMP0118`: the ``GENERATED`` property may
  25. be set only to boolean values, and may not be turned off once turned on.
  26. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.30
  27. .. |WARNS_OR_DOES_NOT_WARN| replace::
  28. does *not* warn
  29. .. include:: include/STANDARD_ADVICE.rst
  30. .. include:: include/DEPRECATED.rst