Files
CMake/Help/prop_tgt/AUTOMOC_INCLUDE_DIRECTORIES.rst
David Worley 39677f4cc6 AUTOMOC: Add option to specify moc include directories explicitly
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
2025-05-19 21:07:48 -04:00

31 lines
1.0 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
AUTOMOC_INCLUDE_DIRECTORIES
---------------------------
.. versionadded:: 4.1
Specifies zero or more include directories for AUTOMOC to pass explicitly to
the Qt MetaObject 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"
)