mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Add a `AUTOMOC_INCLUDE_DIRECTORIES` target property and a corresponding `CMAKE_AUTOMOC_INCLUDE_DIRECTORIES` variable to initialize it. This is useful for targets that do not need moc to search include directories from all dependencies. Closes: #26414
31 lines
1.0 KiB
ReStructuredText
31 lines
1.0 KiB
ReStructuredText
AUTOMOC_INCLUDE_DIRECTORIES
|
||
---------------------------
|
||
|
||
.. versionadded:: 4.1
|
||
|
||
Specifies zero or more include directories for AUTOMOC to pass explicitly to
|
||
the Qt Meta‑Object Compiler (``moc``) instead of automatically discovering a
|
||
target's include directories.
|
||
|
||
When this property is set on a target, only the directories listed here will be
|
||
used by :prop_tgt:`AUTOMOC`, and any other include paths will be ignored.
|
||
|
||
This property may contain :manual:`generator expressions <cmake-generator-expressions(7)>`.
|
||
|
||
All directory paths in the final evaluated result **must be absolute**. If any
|
||
non-absolute paths are present after generator expression evaluation,
|
||
configuration will fail with an error.
|
||
|
||
See also the :variable:`CMAKE_AUTOMOC_INCLUDE_DIRECTORIES` variable, which can
|
||
be used to initialize this property on all targets.
|
||
|
||
Example
|
||
^^^^^^^
|
||
|
||
.. code-block:: cmake
|
||
|
||
add_library(myQtLib ...)
|
||
set_property(TARGET myQtLib PROPERTY AUTOMOC_INCLUDE_DIRECTORIES
|
||
"${CMAKE_CURRENT_SOURCE_DIR}/include/myQtLib"
|
||
)
|