cmake/Help/include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt

19 lines
967 B
Plaintext
Raw Normal View History

2015-04-27 22:25:09 +02:00
2022-03-29 21:10:50 +02:00
Note that it is not advisable to populate the :genex:`INSTALL_INTERFACE` of
the |INTERFACE_PROPERTY_LINK| of a target with absolute paths to the include
2015-08-17 11:37:30 +02:00
directories of dependencies. That would hard-code into installed packages
the include directory paths for dependencies
**as found on the machine the package was made on**.
2015-04-27 22:25:09 +02:00
2022-03-29 21:10:50 +02:00
The :genex:`INSTALL_INTERFACE` of the |INTERFACE_PROPERTY_LINK| is only
2015-08-17 11:37:30 +02:00
suitable for specifying the required include directories for headers
provided with the target itself, not those provided by the transitive
dependencies listed in its :prop_tgt:`INTERFACE_LINK_LIBRARIES` target
property. Those dependencies should themselves be targets that specify
their own header locations in |INTERFACE_PROPERTY_LINK|.
2015-04-27 22:25:09 +02:00
2015-08-17 11:37:30 +02:00
See the :ref:`Creating Relocatable Packages` section of the
:manual:`cmake-packages(7)` manual for discussion of additional care
that must be taken when specifying usage requirements while creating
packages for redistribution.