Add documentation for qt_finalize_project command
Task-number: QTBUG-100207 Pick-to: 6.3 Change-Id: I902ae827efad422771494ae3ad2da48d48d5c9cb Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
f84206ba69
commit
63f79d7ffb
@ -57,3 +57,16 @@ qt_finalize_target(complexapp)
|
||||
qt_android_generate_deployment_settings(myapp)
|
||||
qt_android_add_apk_target(myapp)
|
||||
#! [qt_android_deploy_basic]
|
||||
|
||||
#! [qt_finalize_project_manual]
|
||||
cmake_minimum_required(VERSIONS 3.16)
|
||||
|
||||
project(MyProject LANGUAGES CXX)
|
||||
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core)
|
||||
|
||||
qt_add_executable(MyApp main.cpp)
|
||||
add_subdirectory(mylib)
|
||||
|
||||
qt_finalize_project()
|
||||
#! [qt_finalize_project_manual]
|
||||
|
@ -85,7 +85,10 @@ 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.
|
||||
\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).
|
||||
@ -102,7 +105,8 @@ not be needed unless the project has to support CMake 3.18 or earlier.
|
||||
|
||||
\sa {qt6_finalize_target}{qt_finalize_target()},
|
||||
{qt6_set_finalizer_mode}{qt_set_finalizer_mode()},
|
||||
{qt6_add_library}{qt_add_library()}
|
||||
{qt6_add_library}{qt_add_library()},
|
||||
{qt6_finalize_project}{qt_finalize_project()}
|
||||
|
||||
\section1 Examples
|
||||
|
||||
@ -120,4 +124,6 @@ support using CMake versions earlier than 3.19, we take over responsibility
|
||||
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
|
||||
*/
|
||||
|
@ -66,7 +66,8 @@ respectively, which will be created automatically. Creating of the \c{apk} and
|
||||
\c{QT_NO_GLOBAL_AAB_TARGET} variables to \c{TRUE}.
|
||||
|
||||
\sa {qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()},
|
||||
{qt6_finalize_target}{qt_finalize_target()}
|
||||
{qt6_finalize_target}{qt_finalize_target()},
|
||||
{qt6_finalize_project}{qt_finalize_project()}
|
||||
|
||||
\section1 Example
|
||||
|
||||
|
71
src/corelib/doc/src/cmake/qt_finalize_project.qdoc
Normal file
71
src/corelib/doc/src/cmake/qt_finalize_project.qdoc
Normal file
@ -0,0 +1,71 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2022 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\page qt_finalize_project.html
|
||||
\ingroup cmake-commands-qtcore
|
||||
|
||||
\title qt_finalize_project
|
||||
\target qt6_finalize_project
|
||||
|
||||
\summary {Handles various common platform-specific tasks associated with Qt project.}
|
||||
\preliminarycmakecommand
|
||||
|
||||
\include cmake-find-package-core.qdocinc
|
||||
|
||||
\cmakecommandsince 6.3
|
||||
|
||||
\section1 Synopsis
|
||||
|
||||
\badcode
|
||||
qt_finalize_project()
|
||||
\endcode
|
||||
|
||||
\versionlessCMakeCommandsNote qt6_finalize_project()
|
||||
|
||||
\section1 Description
|
||||
|
||||
Some targets that are created using Qt commands require additional actions
|
||||
at the end of CMake configuring phase. Depending on the platform the function
|
||||
typically walks through the build tree, resolves dependencies between targets
|
||||
created by the user, and applies extra deployment steps.
|
||||
|
||||
With CMake versions 3.19 and higher, you don't need to call this command since
|
||||
it consists of sub-commands that are ordinarily invoked at the end of
|
||||
\c CMAKE_SOURCE_DIR scope.
|
||||
|
||||
\include cmake-android-qt-finalize-project-warning.cmake
|
||||
|
||||
\section2 Examples
|
||||
|
||||
For projects that use a CMake version lower than 3.19, you need to call
|
||||
\c qt_finalize_project manually. This example shows the typical use of the
|
||||
function:
|
||||
|
||||
\snippet cmake-macros/examples.cmake qt_finalize_project_manual
|
||||
|
||||
*/
|
@ -0,0 +1,3 @@
|
||||
\warning If your \e Android project is built using a CMake version lower than
|
||||
3.19, make sure that you call \l{qt_finalize_project}{qt6_finalize_project()} at
|
||||
the end of a top-level CMakeLists.txt.
|
Loading…
x
Reference in New Issue
Block a user