Files
CMake/Help/prop_tgt/EXPORT_PROPERTIES.rst
Brad King 4391913133 Add INTERFACE libraries to generated buildsystem if they have SOURCES
INTERFACE libraries were created with the intention of collecting usage
requirements for use by other targets via `target_link_libraries`.
Therefore they were not allowed to have SOURCES and were not included in
the generated buildsystem.  In practice, this has become limiting:

* Header-only libraries do have sources, they just do not compile.
  Developers should be able to edit those sources (the header files)
  in their IDE.

* Header-only libraries may need to generate some of their header
  files via custom commands.

Some projects work around these limitations by pairing each interface
library with an `add_custom_target` that makes the header files and
custom commands appear in the generated buildsystem and in IDEs.

Lift such limitations by allowing INTERFACE libraries to have SOURCES.
For those with sources, add a corresponding build target to the
generated buildsystem.

Fixes: #19145
2020-08-07 08:46:32 -04:00

25 lines
870 B
ReStructuredText

EXPORT_PROPERTIES
-----------------
.. versionadded:: 3.12
List additional properties to export for a target.
This property contains a list of property names that should be exported by
the :command:`install(EXPORT)` and :command:`export` commands. By default
only a limited number of properties are exported. This property can be used
to additionally export other properties as well.
Properties starting with ``INTERFACE_`` or ``IMPORTED_`` are not allowed as
they are reserved for internal CMake use.
Properties containing generator expressions are also not allowed.
.. note::
Since CMake 3.19, :ref:`Interface Libraries` may have arbitrary
target properties. If a project exports an interface library
with custom properties, the resulting package may not work with
dependents configured by older versions of CMake that reject the
custom properties.