Should the target be processed with automoc (for Qt projects).
is a boolean specifying whether CMake will handle the Qt
preprocessor automatically, i.e. without having to use the
or QT5_WRAP_CPP() macro. Currently Qt4 and Qt5 are supported.
When this property is set
, CMake will scan the header and source files at build time and invoke moc accordingly.
#include "moc_<basename>.cpp"is found, a macro from
AUTOMOC_MACRO_NAMESis expected to appear in the
mocis run on the header file to generate
<AUTOGEN_BUILD_DIR>/includedirectory which is automatically added to the target’s
INCLUDE_DIRECTORIES. This allows the compiler to find the included
moc_<basename>.cppfile regardless of the location the original source.
#include "<basename>.moc"is found, a macro from
AUTOMOC_MACRO_NAMESis expected to appear in the source file and
mocis run on the source file itself.
#include "moc_<basename>.cpp"statement are nonetheless scanned for a macro out of
moc_<basename>.cppfiles are generated in custom directories and automatically included in a generated
<AUTOGEN_BUILD_DIR>/mocs_compilation.cppfile, which is compiled as part of the target.
mocfiles with the same
_pappended to the base name (like
<basename>_p.h), are scanned for a macro out of
AUTOMOC_MACRO_NAMES, and if found,
mocis also executed on those files.
AUTOMOCalways checks multiple header alternative extensions, such as
hxx, etc. when searching for headers.
AUTOMOClooks for the
Q_PLUGIN_METADATAmacro and reruns the
mocwhen the file addressed by the
FILEargument of the macro changes.
This property is initialized by the value of the
variable if it is set when a target is created.
executable will be detected automatically, but can be forced to a certain binary using the
Additional command line options for
can be set via the
By enabling the
variable the rules for searching the files which will be processed by
can be relaxed. See the documentation for this variable for more details.
全局特性在该规范中的 load 定义。
can be used to group the automoc targets together in an IDE, e.g. in MSVS.
Additional macro names to search for can be added to
dependency file names can be extracted from source code by using
Compiler pre definitions for
are written to a
file which is controlled by
The number of parallel
processes to start can be modified by setting
manual for more information on using CMake with Qt.