CMP0160.rst 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. CMP0160
  2. -------
  3. .. versionadded:: 3.29
  4. More read-only target properties now error when trying to set them.
  5. The :command:`set_target_properties` and :command:`set_property` commands
  6. are intended to error out on all read-only properties. However, CMake 3.28 and
  7. below only did this for the following properties:
  8. * :prop_tgt:`HEADER_SETS`
  9. * :prop_tgt:`INTERFACE_HEADER_SETS`
  10. * :prop_tgt:`IMPORTED_GLOBAL`
  11. * :prop_tgt:`MANUALLY_ADDED_DEPENDENCIES`
  12. * :prop_tgt:`NAME`
  13. * :prop_tgt:`TYPE`
  14. This policy enforces the read-only nature of the following target properties:
  15. * :prop_tgt:`ALIAS_GLOBAL`
  16. * :prop_tgt:`BINARY_DIR`
  17. * :prop_tgt:`CXX_MODULE_SETS`
  18. * :prop_tgt:`IMPORTED`
  19. * :prop_tgt:`INTERFACE_CXX_MODULE_SETS`
  20. * :prop_tgt:`LOCATION`
  21. * :prop_tgt:`LOCATION_<CONFIG>`
  22. * :prop_tgt:`SOURCE_DIR`
  23. The ``OLD`` behavior for this policy is to only error out for the properties
  24. :prop_tgt:`MANUALLY_ADDED_DEPENDENCIES`, :prop_tgt:`NAME`, and :prop_tgt:`TYPE`.
  25. The ``NEW`` behavior for this policy is to error out on all target properties
  26. that are documented as read-only.
  27. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.29
  28. .. |WARNS_OR_DOES_NOT_WARN| replace:: warns
  29. .. include:: include/STANDARD_ADVICE.rst
  30. .. include:: include/DEPRECATED.rst