CMake/Help/prop_tgt/IMPORTED_LIBNAME.rst
Brad King 09cda9d5e7 Allow imported INTERFACE libraries to specify a link library name
Add an `IMPORTED_LIBNAME[_<CONFIG>]` target property to specify a library
name to be placed on the link line in place of an interface library
since it has no library file of its own.  Restrict use of the property
to imported `INTERFACE` libraries.

This will be particularly useful for find modules that need to provide
imported libraries from system SDKs where the full path to the library
file is not known.  Now such find modules will be able to provide an
imported interface library and set `IMPORTED_LIBNAME` to refer to the
SDK library by name.

Issue: #15267
2016-11-09 09:45:14 -05:00

24 lines
1.0 KiB
ReStructuredText

IMPORTED_LIBNAME
----------------
Specify the link library name for an :ref:`imported <Imported Targets>`
:ref:`Interface Library <Interface Libraries>`.
An interface library builds no library file itself but does specify
usage requirements for its consumers. The ``IMPORTED_LIBNAME``
property may be set to specify a single library name to be placed
on the link line in place of the interface library target name as
a requirement for using the interface.
This property is intended for use in naming libraries provided by
a platform SDK for which the full path to a library file may not
be known. The value may be a plain library name such as ``foo``
but may *not* be a path (e.g. ``/usr/lib/libfoo.so``) or a flag
(e.g. ``-Wl,...``). The name is never treated as a library target
name even if it happens to name one.
The ``IMPORTED_LIBNAME`` property is allowed only on
:ref:`imported <Imported Targets>` :ref:`Interface Libraries`
and is rejected on targets of other types (for which
the :prop_tgt:`IMPORTED_LOCATION` target property may be used).