Add include directories to a target.
Specify include directories to use when compiling a given target.
<target> must have been created by a command such
add_executable or :command:
add_library and must not be an
BEFORE is specified, the content will be prepended to the property
instead of being appended.
PRIVATE keywords are required to specify
the scope of the following arguments.
PUBLIC items will
populate the :prop_tgt:
INCLUDE_DIRECTORIES property of
INTERFACE items will populate the
<target>. The following arguments specify include
Specified include directories may be absolute paths or relative paths.
Repeated calls for the same
SYSTEM is specified, the compiler will be told the
directories are meant as system include directories on some platforms
(signalling this setting might achieve effects such as the compiler
skipping warnings, or these fixed-install system files not being
considered in dependency calculations - see compiler docs). If
is used together with
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property will be
populated with the specified directories.
target_include_directories may use “generator expressions”
with the syntax
$<...>. See the :manual:
manual for available expressions. See the :manual:
manual for more on defining buildsystem properties.
Include directories usage requirements commonly differ between the build-tree
and the install-tree. The
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
Creating Relocatable Packages ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. |INTERFACE_PROPERTY_LINK| replace:: :prop_tgt:
.. include:: /include/INTERFACE_INCLUDE_DIRECTORIES_WARNING.txt