summaryrefslogtreecommitdiffstats
path: root/Help/manual/cmake-qt.7.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Help/manual/cmake-qt.7.rst')
-rw-r--r--Help/manual/cmake-qt.7.rst22
1 files changed, 13 insertions, 9 deletions
diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst
index 56d4ca7..e9da396 100644
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@ -63,20 +63,24 @@ If a ``Q_OBJECT`` or ``Q_GADGET`` macro is found in a header file, ``moc``
will be run on the file. The result will be put into a file named according
to ``moc_<basename>.cpp``. If the macro is found in a C++ implementation
file, the moc output will be put into a file named according to
-``<basename>.moc``, following the Qt conventions. The ``moc file`` may be
-included by the user in the C++ implementation file with a preprocessor
-``#include``. If it is not so included, it will be added to a separate file
-which is compiled into the target.
+``<basename>.moc``, following the Qt conventions. The ``<basename>.moc`` must
+be included by the user in the C++ implementation file with a preprocessor
+``#include``.
-The ``moc`` command line will consume the :prop_tgt:`COMPILE_DEFINITIONS` and
-:prop_tgt:`INCLUDE_DIRECTORIES` target properties from the target it is being
-invoked for, and for the appropriate build configuration.
-
-The generated ``moc_*.cpp`` and ``*.moc`` files are placed in the
+Included ``moc_*.cpp`` and ``*.moc`` files will be generated in the
``<CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/include`` directory which is
automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`.
(This differs from CMake 3.7 and below; see their documentation for details.)
+Not included ``moc_<basename>.cpp`` files will be generated in custom
+folders to avoid name collisions and included in a separate
+``<CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/moc_compilation.cpp``
+file which is compiled into the target.
+
+The ``moc`` command line will consume the :prop_tgt:`COMPILE_DEFINITIONS` and
+:prop_tgt:`INCLUDE_DIRECTORIES` target properties from the target it is being
+invoked for, and for the appropriate build configuration.
+
The :prop_tgt:`AUTOMOC` target property may be pre-set for all
following targets by setting the :variable:`CMAKE_AUTOMOC` variable. The
:prop_tgt:`AUTOMOC_MOC_OPTIONS` target property may be populated to set