diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-05-15 09:05:58 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-05-26 13:27:17 (GMT) |
commit | dbda590628868e37956838c1d93d54050ab3e7c1 (patch) | |
tree | 636949e74c8f8e398c34a6931cad4a7578aeafe9 /Help/prop_tgt | |
parent | 0965002e57f7461d290792252b289fda9247d530 (diff) | |
download | CMake-dbda590628868e37956838c1d93d54050ab3e7c1.zip CMake-dbda590628868e37956838c1d93d54050ab3e7c1.tar.gz CMake-dbda590628868e37956838c1d93d54050ab3e7c1.tar.bz2 |
Autogen: Per-config file suffixes. New AUTOGEN_BUILD_DIR target property.
Closes #14760
Closes #14313
Diffstat (limited to 'Help/prop_tgt')
-rw-r--r-- | Help/prop_tgt/AUTOGEN_BUILD_DIR.rst | 17 | ||||
-rw-r--r-- | Help/prop_tgt/AUTOMOC.rst | 35 | ||||
-rw-r--r-- | Help/prop_tgt/AUTOUIC.rst | 9 |
3 files changed, 48 insertions, 13 deletions
diff --git a/Help/prop_tgt/AUTOGEN_BUILD_DIR.rst b/Help/prop_tgt/AUTOGEN_BUILD_DIR.rst new file mode 100644 index 0000000..8db6ede --- /dev/null +++ b/Help/prop_tgt/AUTOGEN_BUILD_DIR.rst @@ -0,0 +1,17 @@ +AUTOGEN_BUILD_DIR +----------------- + +Directory where :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTOUIC` and :prop_tgt:`AUTORCC` +generate files for the target. + +The directory is created on demand and automatically added to the +:prop_dir:`ADDITIONAL_MAKE_CLEAN_FILES`. + +When unset or empty the directory ``<dir>/<target-name>_autogen`` is used where +``<dir>`` is :variable:`CMAKE_CURRENT_BINARY_DIR` and ``<target-name>`` +is :prop_tgt:`NAME`. + +By default :prop_tgt:`AUTOGEN_BUILD_DIR` is unset. + +See the :manual:`cmake-qt(7)` manual for more information on using CMake +with Qt. diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst index 7e10fde..81eff82 100644 --- a/Help/prop_tgt/AUTOMOC.rst +++ b/Help/prop_tgt/AUTOMOC.rst @@ -13,13 +13,17 @@ source files at build time and invoke moc accordingly. * If an ``#include`` statement like ``#include "moc_<basename>.cpp"`` is found, the ``Q_OBJECT`` or ``Q_GADGET`` macros are expected in an otherwise empty - line of the ``<basename>.h(xx)`` header file. ``moc`` is run on the header file to - generate ``moc_<basename>.cpp`` in the - ``<CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/include`` directory - which is automatically added to the target's - :prop_tgt:`INCLUDE_DIRECTORIES`. This allows the compiler to find the - included ``moc_<basename>.cpp`` file regardless of the location the - original source. + line of the ``<basename>.h(xx)`` header file. ``moc`` is run on the header + file to generate ``moc_<basename>.cpp`` in the + ``<AUTOGEN_BUILD_DIR>/include`` directory which is automatically added + to the target's :prop_tgt:`INCLUDE_DIRECTORIES`. + This allows the compiler to find the included ``moc_<basename>.cpp`` file + regardless of the location the original source. + + * For multi configuration generators, except Xcode, the include directory is + ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>``. + + * See :prop_tgt:`AUTOGEN_BUILD_DIR`. * If an ``#include`` statement like ``#include "<basename>.moc"`` is found, then ``Q_OBJECT`` or ``Q_GADGET`` macros are expected in the current source @@ -28,10 +32,19 @@ source files at build time and invoke moc accordingly. * Header files that are not included by an ``#include "moc_<basename>.cpp"`` statement are nonetheless scanned for ``Q_OBJECT`` or ``Q_GADGET`` macros. The resulting ``moc_<basename>.cpp`` files are generated in custom - directories and automatically included in the generated - ``<CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/moc_compilation.cpp`` file, - which is compiled as part of the target. The custom directories help to - avoid name collisions for moc files with the same ``<basename>``. + directories and automatically included in a generated + ``<AUTOGEN_BUILD_DIR>/mocs_compilation.cpp`` file, + which is compiled as part of the target. + + * For multi configuration generators, except Xcode, the file names are + ``moc_<basename>_<CONFIG>.cpp`` and + ``<AUTOGEN_BUILD_DIR>/mocs_compilation_<CONFIG>.cpp``. + + * The custom directories with checksum + based names help to avoid name collisions for moc files with the same + ``<basename>``. + + * See :prop_tgt:`AUTOGEN_BUILD_DIR`. * Additionally, header files with the same base name as a source file, (like ``<basename>.h``) or ``_p`` appended to the base name (like diff --git a/Help/prop_tgt/AUTOUIC.rst b/Help/prop_tgt/AUTOUIC.rst index 91d95e5..4a08072 100644 --- a/Help/prop_tgt/AUTOUIC.rst +++ b/Help/prop_tgt/AUTOUIC.rst @@ -14,8 +14,13 @@ and invoke ``uic`` accordingly. If an ``#include`` statement like searched for first in the vicinity of ``source.cpp`` and afterwards in the optional :prop_tgt:`AUTOUIC_SEARCH_PATHS` of the target. ``uic`` is run on the ``foo.ui`` file to generate ``ui_foo.h`` in the directory -``<CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/include``, -which is added to the target's :prop_tgt:`INCLUDE_DIRECTORIES` automatically. +``<AUTOGEN_BUILD_DIR>/include``, +which is automatically added to the target's :prop_tgt:`INCLUDE_DIRECTORIES`. + +* For multi configuration generators, except Xcode, the include directory is + ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>``. + +* See :prop_tgt:`AUTOGEN_BUILD_DIR`. This property is initialized by the value of the :variable:`CMAKE_AUTOUIC` variable if it is set when a target is created. |