cmake/Help/prop_tgt/INTERFACE_INCLUDE_DIRECTORIES.rst

29 lines
1.1 KiB
ReStructuredText
Raw Normal View History

2014-08-03 19:52:23 +02:00
INTERFACE_INCLUDE_DIRECTORIES
-----------------------------
2015-04-27 22:25:09 +02:00
.. |property_name| replace:: include directories
.. |command_name| replace:: :command:`target_include_directories`
.. |PROPERTY_INTERFACE_NAME| replace:: ``INTERFACE_INCLUDE_DIRECTORIES``
.. |PROPERTY_LINK| replace:: :prop_tgt:`INCLUDE_DIRECTORIES`
.. include:: INTERFACE_BUILD_PROPERTY.txt
2014-08-03 19:52:23 +02:00
Include directories usage requirements commonly differ between the build-tree
and the install-tree. The ``BUILD_INTERFACE`` and ``INSTALL_INTERFACE``
generator expressions can be used to describe separate usage requirements
based on the usage location. Relative paths are allowed within the
``INSTALL_INTERFACE`` expression and are interpreted relative to the
installation prefix. For example:
.. code-block:: cmake
2015-04-27 22:25:09 +02:00
target_include_directories(mylib INTERFACE
2014-08-03 19:52:23 +02:00
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/mylib>
$<INSTALL_INTERFACE:include/mylib> # <prefix>/include/mylib
2015-04-27 22:25:09 +02:00
)
2015-08-17 11:37:30 +02:00
Creating Relocatable Packages
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2015-04-27 22:25:09 +02:00
.. |INTERFACE_PROPERTY_LINK| replace:: ``INTERFACE_INCLUDE_DIRECTORIES``
.. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt