diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-05-18 19:42:55 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-05-20 19:40:45 +0200 |
commit | c4df673dd9034bc6dcd0871d27f13d8524ae829e (patch) | |
tree | bbf2cbe2cb964d2393a8b9ad2ceba6b0308b5b96 /src/corelib/doc | |
parent | 560d839461d0baae5d2b7088a32fb0e6f3519a28 (diff) |
CMake: Replace qt_finalize_executable with qt_finalize_target
It's very likely that we'll have to run certain finalizer code for
targets other than executables.
Rename qt_finalize_executable to _qt_internal_finalize_executable so
it's internal.
Introduce a new function qt_finalize_target which will call the above
internal one when the target is an executable.
This should future proof the API so we have a hook to call code for
any user CMake project that intends to use Qt CMake API.
Change-Id: I03f6f4dcba22461351c247a20241ca7de1a59c1d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/corelib/doc')
-rw-r--r-- | src/corelib/doc/snippets/cmake-macros/examples.cmake | 2 | ||||
-rw-r--r-- | src/corelib/doc/src/cmake-macros.qdoc | 22 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/corelib/doc/snippets/cmake-macros/examples.cmake b/src/corelib/doc/snippets/cmake-macros/examples.cmake index c02f5c783d..56d667914d 100644 --- a/src/corelib/doc/snippets/cmake-macros/examples.cmake +++ b/src/corelib/doc/snippets/cmake-macros/examples.cmake @@ -88,7 +88,7 @@ qt_add_executable(simpleapp main.cpp) #! [qt_add_executable_deferred] qt_add_executable(complexapp MANUAL_FINALIZATION complex.cpp) set_target_properties(complexapp PROPERTIES OUTPUT_NAME Complexify) -qt_finalize_executable(complexapp) +qt_finalize_target(complexapp) #! [qt_add_executable_deferred] #! [qt_android_deploy_basic] diff --git a/src/corelib/doc/src/cmake-macros.qdoc b/src/corelib/doc/src/cmake-macros.qdoc index 833aeaff86..9b486712f7 100644 --- a/src/corelib/doc/src/cmake-macros.qdoc +++ b/src/corelib/doc/src/cmake-macros.qdoc @@ -421,7 +421,7 @@ 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_executable}{qt_finalize_executable()} command. +\l{qt6_finalize_target}{qt_finalize_target()} command. 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). @@ -432,11 +432,11 @@ CMake versions earlier than 3.19, automatic deferral isn't supported. In that case, 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_executable}{qt_finalize_executable()} +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. -\sa {qt6_finalize_executable}{qt_finalize_executable()} +\sa {qt6_finalize_target}{qt_finalize_target()} \section1 Examples @@ -457,11 +457,11 @@ for finalizing the target by adding the \c{MANUAL_FINALIZATION} keyword. */ /*! -\page qt_finalize_executable.html +\page qt_finalize_target.html \ingroup cmake-macros-qtcore -\title qt_finalize_executable -\target qt6_finalize_executable +\title qt_finalize_target +\target qt6_finalize_target \brief Handles various common platform-specific tasks associated with Qt targets. @@ -470,9 +470,9 @@ for finalizing the target by adding the \c{MANUAL_FINALIZATION} keyword. \section1 Synopsis \badcode -qt_finalize_executable(target) +qt_finalize_target(target) -qt6_finalize_executable(target) +qt6_finalize_target(target) \endcode \section1 Description @@ -573,7 +573,7 @@ Some are provided by Qt, others by CMake or the Android NDK. The properties below will be read from the specified \c{target}. Note that this command is called as part of target finalization (see -\l{qt6_finalize_executable}{qt_finalize_executable()}). If you are using +\l{qt6_finalize_target}{qt_finalize_target()}). If you are using \l{qt6_add_executable}{qt_add_executable()} to create the target and you need to modify some of these target properties, you need to ensure that target finalization is deferred. See \l{qt6_add_executable}{qt_add_executable()} for @@ -597,7 +597,7 @@ Upon return, the \c{QT_ANDROID_DEPLOYMENT_SETTINGS_FILE} target property will contain the location of the generated deployment settings file. \sa {qt6_android_add_apk_target}{qt_android_add_apk_target()}, - {qt6_finalize_executable}{qt_finalize_executable()} + {qt6_finalize_target}{qt_finalize_target()} \section1 Example @@ -639,7 +639,7 @@ the \c{apk} build target, which will be created if it doesn't already exist. This can be disabled by setting the \c{QT_NO_GLOBAL_APK_TARGET} variable to true. \sa {qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}, - {qt6_finalize_executable}{qt_finalize_executable()} + {qt6_finalize_target}{qt_finalize_target()} \section1 Example |