mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Previously the command did not allow naming targets on the LHS that were not created in the calling directory. Lift this restriction to enable more flexible use by projects. Targets named on the RHS will need to be looked up during generation in the scope of the call site rather than the scope of the LHS target. Introduce an internal syntax in `[INTERFACE_]LINK_LIBRARIES` properties to specify target names that need to be looked up in a directory other than that containing the target on which the property is set. Add minimal documentation of the syntax to help users that encounter it. Unfortunately CMake previously did allow such calls in the case that only `INTERFACE` libraries are specified, but those libraries would be looked up in the target's directory rather than the caller's. Add policy `CMP0079` to enable the new behavior with new lookup scope in a compatible way. Fixes: #17943
27 lines
1.0 KiB
ReStructuredText
27 lines
1.0 KiB
ReStructuredText
INTERFACE_LINK_LIBRARIES
|
|
------------------------
|
|
|
|
List public interface libraries for a library.
|
|
|
|
This property contains the list of transitive link dependencies. When
|
|
the target is linked into another target using the
|
|
:command:`target_link_libraries` command, the libraries listed (and
|
|
recursively their link interface libraries) will be provided to the
|
|
other target also. This property is overridden by the
|
|
:prop_tgt:`LINK_INTERFACE_LIBRARIES` or
|
|
:prop_tgt:`LINK_INTERFACE_LIBRARIES_<CONFIG>` property if policy
|
|
:policy:`CMP0022` is ``OLD`` or unset.
|
|
|
|
Contents of ``INTERFACE_LINK_LIBRARIES`` may use "generator expressions"
|
|
with the syntax ``$<...>``. See the :manual:`cmake-generator-expressions(7)`
|
|
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
|
|
manual for more on defining buildsystem properties.
|
|
|
|
.. include:: LINK_LIBRARIES_INDIRECTION.txt
|
|
|
|
Creating Relocatable Packages
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
.. |INTERFACE_PROPERTY_LINK| replace:: ``INTERFACE_LINK_LIBRARIES``
|
|
.. include:: /include/INTERFACE_LINK_LIBRARIES_WARNING.txt
|