summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/src/cmake/qt_add_executable.qdoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/doc/src/cmake/qt_add_executable.qdoc')
-rw-r--r--src/corelib/doc/src/cmake/qt_add_executable.qdoc35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/corelib/doc/src/cmake/qt_add_executable.qdoc b/src/corelib/doc/src/cmake/qt_add_executable.qdoc
index a09ecc8dfd..cc8c924c79 100644
--- a/src/corelib/doc/src/cmake/qt_add_executable.qdoc
+++ b/src/corelib/doc/src/cmake/qt_add_executable.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_add_executable.html
+\page qt-add-executable.html
\ingroup cmake-commands-qtcore
\title qt_add_executable
-\target qt6_add_executable
+\keyword qt6_add_executable
\summary {Creates and finalizes an application target of a platform-specific type.}
@@ -60,25 +60,34 @@ for you as a convenience.
After a target is created, further processing or \e{finalization} steps are
commonly needed. The steps to perform depend on the platform and on various
-properties of the target. The finalization processing is implemented by the
-\l{qt6_finalize_target}{qt_finalize_target()} command. You might need to also
-call the \l{qt6_finalize_project}{qt_finalize_project()} command at the end
-of top-level CMakeLists.txt to correctly resolve the dependencies between
-project targets.
-
-Finalization can occur either as part of this call or be deferred to sometime
-after this command returns (but it should still be in the same directory scope).
-When using CMake 3.19 or later, finalization is automatically deferred to the
+properties of the target.
+
+The finalization processing is implemented by two commands:
+\l{qt6_finalize_target}{qt_finalize_target()} and
+\l{qt6_finalize_project}{qt_finalize_project()}.
+
+Target finalization can occur either as part of calling \c{qt_add_executable}
+or be deferred to sometime after this command returns (but it should still be in
+the same directory scope).
+
+When using CMake 3.19 or later, target finalization is automatically deferred to the
end of the current directory scope. This gives the caller an opportunity to
modify properties of the created target before it is finalized. When using
CMake versions earlier than 3.19, automatic deferral isn't supported. In that
-case, finalization is performed immediately before this command returns.
+case, target finalization is performed immediately before this command returns.
Regardless of the CMake version, the \c{MANUAL_FINALIZATION} keyword can be given to
indicate that you will explicitly call \l{qt6_finalize_target}{qt_finalize_target()}
yourself instead at some later time. In general, \c MANUAL_FINALIZATION should
not be needed unless the project has to support CMake 3.18 or earlier.
+Project finalization occurs automatically when using CMake 3.19 or later.
+When using an older CMake version, you should call
+\l{qt6_finalize_project}{qt_finalize_project()} manually, at the end
+of the root \c CMakeLists.txt file.
+This is especially important when targeting Android, to collect dependencies
+between project targets for deployment purposes.
+
\sa {qt6_finalize_target}{qt_finalize_target()},
{qt6_set_finalizer_mode}{qt_set_finalizer_mode()},
{qt6_add_library}{qt_add_library()},
@@ -101,5 +110,5 @@ for finalizing the target by adding the \c{MANUAL_FINALIZATION} keyword.
\snippet cmake-macros/examples.cmake qt_add_executable_deferred
-\include cmake-android-qt-finalize-project-warning.cmake
+\include cmake-android-qt-finalize-project-warning.qdocinc warning
*/