2013-10-15 19:17:36 +04:00
|
|
|
include_directories
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
Add include directories to the build.
|
|
|
|
|
|
|
|
::
|
|
|
|
|
2014-02-03 17:20:42 +04:00
|
|
|
include_directories([AFTER|BEFORE] [SYSTEM] dir1 [dir2 ...])
|
2013-10-15 19:17:36 +04:00
|
|
|
|
|
|
|
Add the given directories to those the compiler uses to search for
|
|
|
|
include files. Relative paths are interpreted as relative to the
|
|
|
|
current source directory.
|
|
|
|
|
2014-02-03 17:20:42 +04:00
|
|
|
The include directories are added to the :prop_dir:`INCLUDE_DIRECTORIES`
|
|
|
|
directory property for the current ``CMakeLists`` file. They are also
|
|
|
|
added to the :prop_tgt:`INCLUDE_DIRECTORIES` target property for each
|
|
|
|
target in the current ``CMakeLists`` file. The target property values
|
|
|
|
are the ones used by the generators.
|
2013-10-15 19:17:36 +04:00
|
|
|
|
2014-02-03 17:20:42 +04:00
|
|
|
By default the directories specified are appended onto the current list of
|
2013-10-15 19:17:36 +04:00
|
|
|
directories. This default behavior can be changed by setting
|
2014-02-03 17:20:42 +04:00
|
|
|
:variable:`CMAKE_INCLUDE_DIRECTORIES_BEFORE` to ``ON``. By using
|
|
|
|
``AFTER`` or ``BEFORE`` explicitly, you can select between appending and
|
|
|
|
prepending, independent of the default.
|
2013-10-15 19:17:36 +04:00
|
|
|
|
2014-02-03 17:20:42 +04:00
|
|
|
If the ``SYSTEM`` option is given, 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
|
2013-10-15 19:17:36 +04:00
|
|
|
skipping warnings, or these fixed-install system files not being
|
2014-02-03 17:20:42 +04:00
|
|
|
considered in dependency calculations - see compiler docs.
|
|
|
|
|
|
|
|
Arguments to ``include_directories`` may use "generator expressions" with
|
|
|
|
the syntax "$<...>". See the :manual:`cmake-generator-expressions(7)`
|
|
|
|
manual for available expressions. See the :manual:`cmake-buildsystem(7)`
|
|
|
|
manual for more on defining buildsystem properties.
|