Help: Call out target_link_libraries legacy signatures earlier

This commit is contained in:
Brad King 2025-02-11 09:23:06 -05:00
parent b2674f3b38
commit 639eee1a0c

View File

@ -191,6 +191,9 @@ exclusively by this signature private.
Libraries for a Target and/or its Dependents (Legacy) Libraries for a Target and/or its Dependents (Legacy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This signature is for compatibility only. Prefer the ``PUBLIC`` or
``PRIVATE`` keywords instead.
.. code-block:: cmake .. code-block:: cmake
target_link_libraries(<target> target_link_libraries(<target>
@ -200,9 +203,6 @@ Libraries for a Target and/or its Dependents (Legacy)
The ``LINK_PUBLIC`` and ``LINK_PRIVATE`` modes can be used to specify both The ``LINK_PUBLIC`` and ``LINK_PRIVATE`` modes can be used to specify both
the link dependencies and the link interface in one command. the link dependencies and the link interface in one command.
This signature is for compatibility only. Prefer the ``PUBLIC`` or
``PRIVATE`` keywords instead.
Libraries and targets following ``LINK_PUBLIC`` are linked to, and are Libraries and targets following ``LINK_PUBLIC`` are linked to, and are
made part of the :prop_tgt:`INTERFACE_LINK_LIBRARIES`. If policy made part of the :prop_tgt:`INTERFACE_LINK_LIBRARIES`. If policy
:policy:`CMP0022` is not ``NEW``, they are also made part of the :policy:`CMP0022` is not ``NEW``, they are also made part of the
@ -213,6 +213,9 @@ made part of the :prop_tgt:`INTERFACE_LINK_LIBRARIES`. If policy
Libraries for Dependents Only (Legacy) Libraries for Dependents Only (Legacy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This signature is for compatibility only. Prefer the ``INTERFACE`` mode
instead.
.. code-block:: cmake .. code-block:: cmake
target_link_libraries(<target> LINK_INTERFACE_LIBRARIES <item>...) target_link_libraries(<target> LINK_INTERFACE_LIBRARIES <item>...)
@ -223,9 +226,6 @@ for linking. If policy :policy:`CMP0022` is not ``NEW``, then this mode
also appends libraries to the :prop_tgt:`LINK_INTERFACE_LIBRARIES` and its also appends libraries to the :prop_tgt:`LINK_INTERFACE_LIBRARIES` and its
per-configuration equivalent. per-configuration equivalent.
This signature is for compatibility only. Prefer the ``INTERFACE`` mode
instead.
Libraries specified as ``debug`` are wrapped in a generator expression to Libraries specified as ``debug`` are wrapped in a generator expression to
correspond to debug builds. If policy :policy:`CMP0022` is correspond to debug builds. If policy :policy:`CMP0022` is
not ``NEW``, the libraries are also appended to the not ``NEW``, the libraries are also appended to the