CMP0189.rst 1.6 KB

1234567891011121314151617181920212223242526272829303132333435
  1. CMP0189
  2. -------
  3. .. versionadded:: 4.1
  4. :genex:`TARGET_PROPERTY` evaluates ``LINK_LIBRARIES`` properties transitively.
  5. The :prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
  6. target properties record link dependencies through which the
  7. :genex:`TARGET_PROPERTY` generator expression evaluates transitive properties.
  8. However, in CMake 4.0 and below, the properties themselves were not evaluated
  9. transitively. CMake 4.1 and above prefer to evaluate the
  10. :prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
  11. target properties transitively because they are among the
  12. :ref:`build specification <Target Build Specification>` and
  13. :ref:`usage requirement <Target Usage Requirements>` properties, respectively.
  14. This policy provides compatibility for projects that have not been updated to
  15. expect the new behavior. It takes effect during buildsystem generation.
  16. Generator expressions are evaluated in each directory using the policy setting
  17. as of the end of its ``CMakeLists.txt``. As an exception, generator
  18. expressions evaluated by the :command:`file(GENERATE)` command use the
  19. policy setting as of its call site.
  20. The ``OLD`` behavior of this policy is for :genex:`TARGET_PROPERTY` to not
  21. evaluate :prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
  22. transitively. The ``NEW`` behavior is for :genex:`TARGET_PROPERTY` to
  23. evaluate :prop_tgt:`LINK_LIBRARIES` and :prop_tgt:`INTERFACE_LINK_LIBRARIES`
  24. transitively.
  25. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 4.1
  26. .. |WARNS_OR_DOES_NOT_WARN| replace:: does *not* warn
  27. .. include:: include/STANDARD_ADVICE.rst
  28. .. include:: include/DEPRECATED.rst