CMP0028.rst 1.2 KB

12345678910111213141516171819202122232425262728
  1. CMP0028
  2. -------
  3. .. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
  4. .. include:: include/REMOVED_PROLOGUE.rst
  5. Double colon in target name means ``ALIAS`` or ``IMPORTED`` target.
  6. CMake 2.8.12 and lower allowed the use of targets and files with double
  7. colons in :command:`target_link_libraries`, with some buildsystem generators.
  8. The use of double-colons is a common pattern used to namespace ``IMPORTED``
  9. targets and ``ALIAS`` targets. When computing the link dependencies of
  10. a target, the name of each dependency could either be a target, or a file
  11. on disk. Previously, if a target was not found with a matching name, the name
  12. was considered to refer to a file on disk. This can lead to confusing error
  13. messages if there is a typo in what should be a target name.
  14. See also the :prop_tgt:`LINK_LIBRARIES_ONLY_TARGETS` target property.
  15. The ``OLD`` behavior for this policy is to search for targets, then files on
  16. disk, even if the search term contains double-colons. The ``NEW`` behavior
  17. for this policy is to issue a ``FATAL_ERROR`` if a link dependency contains
  18. double-colons but is not an ``IMPORTED`` target or an ``ALIAS`` target.
  19. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 3.0
  20. .. |WARNED_OR_DID_NOT_WARN| replace:: warned
  21. .. include:: include/REMOVED_EPILOGUE.rst