summaryrefslogtreecommitdiffstats
path: root/Help
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-05-15 09:05:58 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-05-26 13:27:17 (GMT)
commitdbda590628868e37956838c1d93d54050ab3e7c1 (patch)
tree636949e74c8f8e398c34a6931cad4a7578aeafe9 /Help
parent0965002e57f7461d290792252b289fda9247d530 (diff)
downloadCMake-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')
-rw-r--r--Help/manual/cmake-properties.7.rst1
-rw-r--r--Help/manual/cmake-qt.7.rst23
-rw-r--r--Help/prop_tgt/AUTOGEN_BUILD_DIR.rst17
-rw-r--r--Help/prop_tgt/AUTOMOC.rst35
-rw-r--r--Help/prop_tgt/AUTOUIC.rst9
-rw-r--r--Help/release/dev/Autogen_build_dir.rst6
6 files changed, 74 insertions, 17 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst
index 38cc0d8..ec25596 100644
--- a/Help/manual/cmake-properties.7.rst
+++ b/Help/manual/cmake-properties.7.rst
@@ -119,6 +119,7 @@ Properties on Targets
/prop_tgt/ARCHIVE_OUTPUT_DIRECTORY
/prop_tgt/ARCHIVE_OUTPUT_NAME_CONFIG
/prop_tgt/ARCHIVE_OUTPUT_NAME
+ /prop_tgt/AUTOGEN_BUILD_DIR
/prop_tgt/AUTOGEN_TARGET_DEPENDS
/prop_tgt/AUTOMOC_DEPEND_FILTERS
/prop_tgt/AUTOMOC_MOC_OPTIONS
diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst
index 3b95b05..9f3968c 100644
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@ -68,14 +68,24 @@ be included by the user in the C++ implementation file with a preprocessor
``#include``.
Included ``moc_*.cpp`` and ``*.moc`` files will be generated in the
-``<CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/include`` directory which is
+``<AUTOGEN_BUILD_DIR>/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.)
+* For multi configuration generators, except Xcode, the include directory is
+ ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>``.
+
+* See :prop_tgt:`AUTOGEN_BUILD_DIR`.
+
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.
+``<AUTOGEN_BUILD_DIR>/mocs_compilation.cpp`` file which is compiled
+into the target.
+
+* For multi configuration generators, except Xcode, the file is
+ ``<AUTOGEN_BUILD_DIR>/mocs_compilation_<CONFIG>.cpp``.
+
+* See :prop_tgt:`AUTOGEN_BUILD_DIR`.
The ``moc`` command line will consume the :prop_tgt:`COMPILE_DEFINITIONS` and
:prop_tgt:`INCLUDE_DIRECTORIES` target properties from the target it is being
@@ -109,10 +119,15 @@ searched for first in the vicinity of including file and afterwards in the
optional :prop_tgt:`AUTOUIC_SEARCH_PATHS` of the target.
The generated generated ``ui_*.h`` files are placed in the
-``<CMAKE_CURRENT_BINARY_DIR>/<TARGETNAME>_autogen/include`` directory which is
+``<AUTOGEN_BUILD_DIR>/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.)
+* For multi configuration generators, except Xcode, the include directory is
+ ``<AUTOGEN_BUILD_DIR>/include_<CONFIG>``.
+
+* See :prop_tgt:`AUTOGEN_BUILD_DIR`.
+
The :prop_tgt:`AUTOUIC` target property may be pre-set for all following
targets by setting the :variable:`CMAKE_AUTOUIC` variable. The
:prop_tgt:`AUTOUIC_OPTIONS` target property may be populated to set options
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.
diff --git a/Help/release/dev/Autogen_build_dir.rst b/Help/release/dev/Autogen_build_dir.rst
new file mode 100644
index 0000000..d11c00b
--- /dev/null
+++ b/Help/release/dev/Autogen_build_dir.rst
@@ -0,0 +1,6 @@
+AutoGen build dir
+-----------------
+
+* The new target property :prop_tgt:`AUTOGEN_BUILD_DIR` was introduced which
+ allows to set a custom output directory for
+ :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTOUIC` and :prop_tgt:`AUTORCC`.