summaryrefslogtreecommitdiffstats
path: root/src/corelib/doc/src/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/doc/src/cmake')
-rw-r--r--src/corelib/doc/src/cmake/cmake-commands.qdoc1
-rw-r--r--src/corelib/doc/src/cmake/cmake-configure-variables.qdoc373
-rw-r--r--src/corelib/doc/src/cmake/cmake-deploy-variables.qdoc133
-rw-r--r--src/corelib/doc/src/cmake/cmake-properties.qdoc230
-rw-r--r--src/corelib/doc/src/cmake/cmake-standard-properties.qdoc24
-rw-r--r--src/corelib/doc/src/cmake/policy/qtp0002.qdoc63
-rw-r--r--src/corelib/doc/src/cmake/policy/qtp0003.qdoc46
-rw-r--r--src/corelib/doc/src/cmake/qt_add_big_resources.qdoc4
-rw-r--r--src/corelib/doc/src/cmake/qt_add_binary_resources.qdoc4
-rw-r--r--src/corelib/doc/src/cmake/qt_add_executable.qdoc35
-rw-r--r--src/corelib/doc/src/cmake/qt_add_library.qdoc13
-rw-r--r--src/corelib/doc/src/cmake/qt_add_plugin.qdoc21
-rw-r--r--src/corelib/doc/src/cmake/qt_add_resources.qdoc23
-rw-r--r--src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc4
-rw-r--r--src/corelib/doc/src/cmake/qt_android_add_apk_target.qdoc6
-rw-r--r--src/corelib/doc/src/cmake/qt_android_apply_arch_suffix.qdoc7
-rw-r--r--src/corelib/doc/src/cmake/qt_android_generate_deployment_settings.qdoc6
-rw-r--r--src/corelib/doc/src/cmake/qt_deploy_qt_conf.qdoc14
-rw-r--r--src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc113
-rw-r--r--src/corelib/doc/src/cmake/qt_deploy_translations.qdoc76
-rw-r--r--src/corelib/doc/src/cmake/qt_disable_unicode_defines.qdoc4
-rw-r--r--src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc18
-rw-r--r--src/corelib/doc/src/cmake/qt_finalize_project.qdoc26
-rw-r--r--src/corelib/doc/src/cmake/qt_finalize_target.qdoc14
-rw-r--r--src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc76
-rw-r--r--src/corelib/doc/src/cmake/qt_generate_deploy_script.qdoc65
-rw-r--r--src/corelib/doc/src/cmake/qt_generate_moc.qdoc4
-rw-r--r--src/corelib/doc/src/cmake/qt_import_plugins.qdoc38
-rw-r--r--src/corelib/doc/src/cmake/qt_policy.qdoc65
-rw-r--r--src/corelib/doc/src/cmake/qt_set_finalizer_mode.qdoc4
-rw-r--r--src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc41
-rw-r--r--src/corelib/doc/src/cmake/qt_wrap_cpp.qdoc42
32 files changed, 1374 insertions, 219 deletions
diff --git a/src/corelib/doc/src/cmake/cmake-commands.qdoc b/src/corelib/doc/src/cmake/cmake-commands.qdoc
index 7e98c16e41..e185bab624 100644
--- a/src/corelib/doc/src/cmake/cmake-commands.qdoc
+++ b/src/corelib/doc/src/cmake/cmake-commands.qdoc
@@ -4,6 +4,7 @@
/*!
\group cmake-commands-qtcore
\title CMake Commands in Qt6 Core
+\brief Lists CMake commands defined in Qt6::Core.
The following CMake commands are defined when Qt6::Core is loaded, for instance
with
diff --git a/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc b/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc
index 116e08fef4..b710ba7275 100644
--- a/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc
+++ b/src/corelib/doc/src/cmake/cmake-configure-variables.qdoc
@@ -10,6 +10,7 @@
/*!
\group cmake-variables-qtcore
\title CMake Variables in Qt6 Core
+\brief Lists CMake variables defined in Qt6::Core.
The following CMake variables are defined when Qt6::Core is loaded, for instance
with
@@ -21,8 +22,8 @@ find_package(Qt6 REQUIRED COMPONENTS Core)
\sa{CMake Variable Reference}
*/
-*/*!
-\page cmake-variable-ANDROID_NDK_HOST_SYSTEM_NAME.html
+/*!
+\page cmake-variable-android-ndk-host-system-name.html
\ingroup cmake-variables-qtcore
\title ANDROID_NDK_HOST_SYSTEM_NAME
@@ -34,14 +35,14 @@ find_package(Qt6 REQUIRED COMPONENTS Core)
\preliminarycmakevariable
\cmakevariableandroidonly
-This is normally set by the Android NDK toolchain file. It is written out as
+Usually, this variable is set by the Android NDK toolchain file. It is written out as
part of the deployment settings for a target.
\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
*/
/*!
-\page cmake-variable-ANDROID_SDK_ROOT.html
+\page cmake-variable-android-sdk-root.html
\ingroup cmake-variables-qtcore
\title ANDROID_SDK_ROOT
@@ -53,15 +54,16 @@ part of the deployment settings for a target.
\preliminarycmakevariable
\cmakevariableandroidonly
-This specifies the location of the Android SDK when building for the Android platform.
-It is written out as part of the deployment settings for a target.
+Specifies the location of the Android SDK when building for the Android platform.
+This variable is written out as part of the deployment settings for a target.
\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}.
*/
/*!
-\page cmake-variable-QT_ANDROID_APPLICATION_ARGUMENTS.html
+\page cmake-variable-qt-android-application-arguments.html
\ingroup cmake-variables-qtcore
+\ingroup cmake-android-manifest-properties
\title QT_ANDROID_APPLICATION_ARGUMENTS
\target cmake-variable-QT_ANDROID_APPLICATION_ARGUMENTS
@@ -72,15 +74,122 @@ It is written out as part of the deployment settings for a target.
\preliminarycmakevariable
\cmakevariableandroidonly
-This contains a list of arguments to be passed to Android applications. It is written
-out as part of the deployment settings for a target.
+Contains a list of arguments to be passed to Android applications. This variable
+is written out as part of the deployment settings for a target.
\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
*/
/*!
-\page cmake-variable-QT_ANDROID_BUILD_ALL_ABIS.html
+\page cmake-variable-qt-android-deployment-type.html
\ingroup cmake-variables-qtcore
+\ingroup cmake-android-build-properties
+
+\title QT_ANDROID_DEPLOYMENT_TYPE
+\target cmake-variable-QT_ANDROID_DEPLOYMENT_TYPE
+
+\summary {Forces or disables release package signing regardless of the build type.}
+
+\cmakevariablesince 6.7
+\preliminarycmakevariable
+\cmakevariableandroidonly
+
+When set to \c Release, the \c --release flag is passed to the \c
+androiddeployqt tool, regardless of the application build type. When set to
+another value, the \c --release flag is never passed to the tool, which
+effectively disables release package signing even in Release or RelWithDebInfo
+builds. When not set, the default behavior is to use release package signing in
+build types other than Debug.
+
+\sa {androiddeployqt}
+*/
+
+/*!
+\page cmake_variable-qt-android-multi-abi-forward-vars
+\ingroup cmake-variables-qtcore
+\ingroup cmake-android-build-properties
+
+\title QT_ANDROID_MULTI_ABI_FORWARD_VARS
+\target cmake-variable-QT_ANDROID_MULTI_ABI_FORWARD_VARS
+
+\summary {Allows to share CMake variables in multi-ABI builds.}
+
+\cmakevariablesince 6.4.2
+\preliminarycmakevariable
+\cmakevariableandroidonly
+
+Allows specifying the list of
+CMake variables that need to be forwarded from the main ABI project to
+ABI-specific subprojects. Due to the specifics of the Multi-ABI project build
+process, there is no generic way to forward the CMake cache variables
+that are specified either in the command line or in another similar way.
+
+A typical use case for the variable is propagating CMake cache variables
+specified in the command line. For example, a project has two variables
+\c{PROJECT_WIDE_VARIABLE1} and \c{PROJECT_WIDE_VARIABLE2} that affect the
+project configuration:
+\badcode
+cmake_minimum_required(VERSION 3.18)
+
+project(MyProject LANGUAGES CXX)
+
+find_package(Qt6 REQUIRED COMPONENTS Core)
+
+qt_add_executable(MyApp main.cpp)
+
+if(PROJECT_WIDE_VARIABLE1)
+ target_sources(MyApp PRIVATE sourcefile1.cpp)
+endif()
+if(PROJECT_WIDE_VARIABLE2)
+ target_sources(MyApp PRIVATE sourcefile2.cpp)
+endif()
+\endcode
+
+The above contents of \c{CMakeLists.txt} enable you to control how
+\c{MyApp} is built by setting the corresponding CMake variables from the
+command line:
+\badcode
+qt-cmake -S<source directory> -B<build directory> \
+ -DPROJECT_WIDE_VARIABLE1=ON \
+ -DPROJECT_WIDE_VARIABLE2=ON \
+ -DQT_ANDROID_MULTI_ABI_FORWARD_VARS="PROJECT_WIDE_VARIABLE1;PROJECT_WIDE_VARIABLE2"
+\endcode
+
+When configuring the application for desktop, \c{PROJECT_WIDE_VARIABLE1} and
+\c{PROJECT_WIDE_VARIABLE2} are visible in CMake listings and scripts as global
+cache variables. This doesn't work for Android Multi-ABI builds because
+ABI-specific subprojects do not inherit the cache variables from the main-ABI
+project. This issue can be solved by passing the list of required variables to
+the \c{QT_ANDROID_MULTI_ABI_FORWARD_VARS} variable, so both
+\c{PROJECT_WIDE_VARIABLE1} and \c{PROJECT_WIDE_VARIABLE2} values will be
+propagated to the ABI-specific builds.
+
+The variable can be also defined in the project's CMakeLists.txt:
+\badcode
+...
+qt_add_executable(MyApp main.cpp)
+...
+if(ANDROID)
+ set(QT_ANDROID_MULTI_ABI_FORWARD_VARS "PROJECT_WIDE_VARIABLE1;PROJECT_WIDE_VARIABLE2")
+endif()
+...
+\endcode
+
+Set the variable in this way to have a predefined set of
+variables that will always be forwarded to ABI-specific projects.
+
+\note The forwarding is done in the target finalizer, which is implicitly
+called when \l{qt6_add_executable}{qt_add_executable()} is used. The
+finalization occurs automatically when using CMake 3.19 or later.
+
+\sa {qt6_finalize_target}{qt_finalize_target()},
+ {qt6_add_executable}{qt_add_executable()}
+*/
+
+/*!
+\page cmake-variable-qt-android-build-all-abis.html
+\ingroup cmake-variables-qtcore
+\ingroup cmake-android-build-properties
\title QT_ANDROID_BUILD_ALL_ABIS
\target cmake-variable-QT_ANDROID_BUILD_ALL_ABIS
@@ -91,29 +200,30 @@ out as part of the deployment settings for a target.
\preliminarycmakevariable
\cmakevariableandroidonly
-The option automatically detects available ABIs of Qt for Android and uses them to
+Automatically detects available ABIs of Qt for Android and uses them to
build a package. The automatic detection expects the default directory structure
supplied by the Qt installer, with the corresponding naming of the directories.
\include cmake-android-supported-abis.qdocinc
The typical directory structure looks as below:
\badcode
/path/to/Qt/6.x.x
-    android_armv7
-    android_arm64_v8a
-    android_x86
-    android_x86_64
-    ...
+ android_armv7
+ android_arm64_v8a
+ android_x86
+ android_x86_64
+ ...
\endcode
The auto-detected paths can be customized using one of \c{QT_PATH_ANDROID_ABI_<ABI>} variables.
-The variable is set to FALSE by default.
+The variable is set to \c FALSE by default.
\sa{QT_PATH_ANDROID_ABI_<ABI>}
*/
/*!
-\page cmake-variable-QT_ANDROID_ABIS.html
+\page cmake-variable-qt-android-abis.html
\ingroup cmake-variables-qtcore
+\ingroup cmake-android-build-properties
\title QT_ANDROID_ABIS
\target cmake-variable-QT_ANDROID_ABIS
@@ -124,10 +234,10 @@ The variable is set to FALSE by default.
\preliminarycmakevariable
\cmakevariableandroidonly
-This variable specifies a list of ABIs to be used to build the project packages.
+Specifies a list of ABIs to be used to build the project packages.
\include cmake-android-supported-abis.qdocinc
Each ABI should have the corresponding Qt for Android either installed or
-user-built. It's possible to specify the path to the Qt for Android ABI using
+user-built. To specify the path to the Qt for Android ABI, use
the corresponding \c{QT_PATH_ANDROID_ABI_<ABI>} variable.
\note \c{QT_ANDROID_BUILD_ALL_ABIS} has the higher priority and ignores the
@@ -137,7 +247,7 @@ QT_ANDROID_ABIS logic.
*/
/*!
-\page cmake-variable-QT_PATH_ANDROID_ABI.html
+\page cmake-variable-qt-path-android-abi.html
\ingroup cmake-variables-qtcore
\title QT_PATH_ANDROID_ABI_<ABI>
@@ -156,18 +266,45 @@ Each variable can be used to specify the path to Qt for Android for the correspo
*/
/*!
-\page cmake-variable-QT_ANDROID_SIGN_APK.html
+\page cmake-variable-qt-android-sign-aab.html
+\ingroup cmake-variables-qtcore
+\ingroup cmake-android-build-properties
+
+\title QT_ANDROID_SIGN_AAB
+\target cmake-variable-QT_ANDROID_SIGN_AAB
+
+\summary {Signs the .aab package with the specified keystore, alias, and store password.}
+\cmakevariablesince 6.4
+\preliminarycmakevariable
+\cmakevariableandroidonly
+
+Signs the resulting package. The path of the keystore file, the alias of the key, and passwords
+have to be specified by additional environment variables:
+\badcode
+ QT_ANDROID_KEYSTORE_PATH
+ QT_ANDROID_KEYSTORE_ALIAS
+ QT_ANDROID_KEYSTORE_STORE_PASS
+ QT_ANDROID_KEYSTORE_KEY_PASS
+\endcode
+The mentioned variables are used internally by \l{androiddeployqt}.
+
+\sa{androiddeployqt}
+*/
+
+/*!
+\page cmake-variable-qt-android-sign-apk.html
\ingroup cmake-variables-qtcore
+\ingroup cmake-android-build-properties
\title QT_ANDROID_SIGN_APK
\target cmake-variable-QT_ANDROID_SIGN_APK
-\summary {Sign the package with the specified keystore, alias and store password.}
+\summary {Signs the package with the specified keystore, alias, and store password.}
\cmakevariablesince 6.4
\preliminarycmakevariable
\cmakevariableandroidonly
-Sign the resulting package. The path of the keystore file, the alias of the key and passwords
+Signs the resulting package. The path of the keystore file, the alias of the key, and passwords
have to be specified by additional environment variables:
\badcode
QT_ANDROID_KEYSTORE_PATH
@@ -175,13 +312,83 @@ have to be specified by additional environment variables:
QT_ANDROID_KEYSTORE_STORE_PASS
QT_ANDROID_KEYSTORE_KEY_PASS
\endcode
-Mentioned variables are used internally by \l{androiddeployqt}.
+The mentioned variables are used internally by \l{androiddeployqt}.
\sa{androiddeployqt}
*/
/*!
-\page cmake-variable-QT_HOST_PATH.html
+\page cmake-variable-qt-use-target-android-build-dir.html
+\ingroup cmake-variables-qtcore
+
+\title QT_USE_TARGET_ANDROID_BUILD_DIR
+\target cmake-variable-QT_USE_TARGET_ANDROID_BUILD_DIR
+
+\summary {Enables the use of per-target Android build directories.}
+
+\cmakevariablesince 6.7
+\preliminarycmakevariable
+\cmakevariableandroidonly
+
+The variable appends the target-specific suffix to the android-build directory.
+The variable only takes an effect when it's set in \c CACHE. The variable is
+only supported by Qt Creator starting from version 13.
+If a single \c CMakeLists.txt contains more than one Android executable and
+this option is not set, you will see a warning. To disable the warning, set
+\c QT_SKIP_ANDROID_BUILD_DIR_CHECK to \c TRUE.
+*/
+
+/*!
+\page cmake-variable-qt-no-collect-build-tree-apk-deps.html
+\ingroup cmake-variables-qtcore
+
+\title QT_NO_COLLECT_BUILD_TREE_APK_DEPS
+\target cmake-variable-QT_NO_COLLECT_BUILD_TREE_APK_DEPS
+
+\summary {Prevents collecting of project-built shared library targets during Android deployment.}
+
+\cmakevariablesince 6.3
+\preliminarycmakevariable
+\cmakevariableandroidonly
+
+During project finalization, the build system collects the locations of
+all built shared library targets in the project.
+These locations are passed to \l androiddeployqt for deployment consideration when
+resolving dependencies between libraries.
+To disable this behavior, set this variable to \c TRUE.
+
+\sa {qt6_finalize_project}{qt_finalize_project()}
+\sa {cmake-variable-QT_NO_COLLECT_IMPORTED_TARGET_APK_DEPS}{QT_NO_COLLECT_IMPORTED_TARGET_APK_DEPS}
+*/
+
+/*!
+\page cmake-variable-qt-no-collect-imported-target-apk-deps.html
+\ingroup cmake-variables-qtcore
+
+\title QT_NO_COLLECT_IMPORTED_TARGET_APK_DEPS
+\target cmake-variable-QT_NO_COLLECT_IMPORTED_TARGET_APK_DEPS
+
+\summary {Prevents collecting of imported targets during Android deployment.}
+
+\cmakevariablesince 6.5
+\preliminarycmakevariable
+\cmakevariableandroidonly
+
+When using CMake version 3.21 or later, the build system collects the locations of
+imported shared library targets that might be relevant for deployment.
+The collected targets are those that are reachable from the directory scope
+of the currently processed executable target. That includes the target's source directory
+scope and its parents.
+The collected locations are passed to \l androiddeployqt for deployment consideration when
+resolving dependencies between libraries.
+To disable this behavior, set this variable to \c TRUE.
+
+\sa {qt6_finalize_project}{qt_finalize_project()}
+\sa {cmake-variable-QT_NO_COLLECT_BUILD_TREE_APK_DEPS}{QT_NO_COLLECT_BUILD_TREE_APK_DEPS}
+*/
+
+/*!
+\page cmake-variable-qt-host-path.html
\ingroup cmake-variables-qtcore
\title QT_HOST_PATH
@@ -190,15 +397,17 @@ Mentioned variables are used internally by \l{androiddeployqt}.
\summary {Location of the host Qt installation when cross-compiling.}
\cmakevariablesince 6.0
-\preliminarycmakevariable
-When cross-compiling, this must be set to the install location of Qt for the host
+When cross-compiling, this variable must be set to the install location of Qt for the host
platform. It is used to locate tools to be run on the host (\l{moc}, \l{rcc},
-\l{androiddeployqt}, and so on).
+\l{androiddeployqt}, and so on). It's possible to reuse pre-installed tools
+when compiling Qt for host systems too, by using \c QT_HOST_PATH that points to
+a pre-installed host Qt and setting the \c QT_FORCE_FIND_TOOLS to \c ON. The Qt
+versions should match in this case.
*/
/*!
-\page cmake-variable-QT_NO_SET_XCODE_DEVELOPMENT_TEAM_ID.html
+\page cmake-variable-qt-no-set-xcode-development-team-id.html
\ingroup cmake-variables-qtcore
\title QT_NO_SET_XCODE_DEVELOPMENT_TEAM_ID
@@ -211,11 +420,11 @@ platform. It is used to locate tools to be run on the host (\l{moc}, \l{rcc},
When finalizing an executable target on iOS,
\l{qt6_finalize_target}{qt_finalize_target()} will populate the target's
\c XCODE_ATTRIBUTE_DEVELOPMENT_TEAM property if it hasn't been set.
-Set \c QT_NO_SET_XCODE_DEVELOPMENT_TEAM_ID to true if you want to prevent this.
+To prevent this, set \c QT_NO_SET_XCODE_DEVELOPMENT_TEAM_ID to \c TRUE.
*/
/*!
-\page cmake-variable-QT_NO_SET_XCODE_BUNDLE_IDENTIFIER.html
+\page cmake-variable-qt-no-set-xcode-bundle-identifier.html
\ingroup cmake-variables-qtcore
\title QT_NO_SET_XCODE_BUNDLE_IDENTIFIER
@@ -229,17 +438,17 @@ When finalizing an executable target on iOS,
\l{qt6_finalize_target}{qt_finalize_target()} will populate the target's
\c XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER and
\c MACOSX_BUNDLE_GUI_IDENTIFIER properties if they haven't been set.
-Set \c QT_NO_SET_XCODE_BUNDLE_IDENTIFIER to true if you want to prevent this.
+To prevent this, set \c QT_NO_SET_XCODE_BUNDLE_IDENTIFIER to \c TRUE.
*/
/*!
-\page cmake-variable-QT_ENABLE_VERBOSE_DEPLOYMENT.html
+\page cmake-variable-qt-enable-verbose-deployment.html
\ingroup cmake-variables-qtcore
\title QT_ENABLE_VERBOSE_DEPLOYMENT
\target cmake-variable-QT_ENABLE_VERBOSE_DEPLOYMENT
-\summary {Enables verbose mode of deployment tools}
+\summary {Enables verbose mode of deployment tools.}
\cmakevariablesince 6.3
\preliminarycmakevariable
@@ -248,12 +457,12 @@ Enables verbose mode of the \l androiddeployqt deployment tool when it is called
internally at build time, usually during target finalization.
This variable also changes the default verbosity of install-time deployment
-scripts for other platforms (see \l{qt_deploy_runtime_dependencies()}), but it
+scripts for other platforms (see \l{qt6_deploy_runtime_dependencies()}), but it
must be set before the first \c{find_package(Qt6)} call to have that effect.
*/
/*!
-\page cmake-variable-QT_DEPLOY_SUPPORT.html
+\page cmake-variable-qt-deploy-support.html
\ingroup cmake-variables-qtcore
\title QT_DEPLOY_SUPPORT
@@ -268,19 +477,20 @@ must be set before the first \c{find_package(Qt6)} call to have that effect.
This configure-phase variable is set by the Core package. It is intended to be
used as the first line of any deployment script to ensure access to the
deployment APIs provided by Qt. Such deployment scripts do not run during
-CMake's configure phase, they are executed during installation or as
+CMake's configure phase. They are executed during installation or as
part of a post-build rule.
The following example shows one way the variable would be used when installing
an application, along with its runtime dependencies:
-\include cmake-deploy-runtime-dependencies.qdocinc
+\include cmake-deploy-modified-variable-values.qdocinc
-\sa qt_deploy_runtime_dependencies(), qt_deploy_qml_imports()
+\sa {qt6_deploy_runtime_dependencies}{qt_deploy_runtime_dependencies()},
+ {qt6_deploy_qml_imports}{qt_deploy_qml_imports()}
*/
/*!
-\page cmake-variable-QT_NO_STANDARD_PROJECT_SETUP.html
+\page cmake-variable-qt-no-standard-project-setup.html
\ingroup cmake-variables-qtcore
\title QT_NO_STANDARD_PROJECT_SETUP
@@ -289,16 +499,89 @@ an application, along with its runtime dependencies:
\summary {Prevents subsequent calls to qt_standard_project_setup() from making any changes.}
\cmakevariablesince 6.3
-\preliminarycmakevariable
The \l{qt6_standard_project_setup}{qt_standard_project_setup()} command is
typically called in the top level \c{CMakeLists.txt} file of a project. In some
-scenarios, such projects may be absorbed as a child project of a larger project
+scenarios, such a project may be absorbed as a child project of a larger project
hierarchy. A parent project may want to prevent any child project from applying
changes to the setup. The parent project can achieve this by setting
-\c{QT_NO_STANDARD_PROJECT_SETUP} to true before bringing in the child project
-via \l{add_subdirectory()}, \l{FetchContent_MakeAvailable()} or other similar
+\c{QT_NO_STANDARD_PROJECT_SETUP} to \c TRUE before bringing in the child project
+via \l{add_subdirectory()}, \l{FetchContent_MakeAvailable()}, or other similar
methods provided by CMake.
\sa {qt6_standard_project_setup}{qt_standard_project_setup()}
*/
+
+/*!
+\page cmake-variable-qt-i18n-languages.html
+\ingroup cmake-variables-qtcore
+
+\title QT_I18N_TRANSLATED_LANGUAGES
+\target cmake-variable-QT_I18N_TRANSLATED_LANGUAGES
+
+\summary {List of languages to be used for project internationalization.}
+
+\cmakevariablesince 6.7
+
+Specifies a list of languages that are used for project
+internationalization. The single languages must be compatible with the
+string-based \l QLocale constructor.
+
+The languages in \c QT_I18N_TRANSLATED_LANGUAGES are used to:
+\list
+ \li Set up executable targets for consuming \c{.qm} files.
+ \li Automatically construct \c{.ts} file names in
+ \l{qt6_add_translations}{qt_add_translations()}.
+\endlist
+
+This variable can be conveniently set with the
+\l {qt6_standard_project_setup}{qt_standard_project_setup()} command.
+
+By default, translatable strings are considered to be written in \c{en}.
+
+\sa {qt6_standard_project_setup}{qt_standard_project_setup()}
+\sa {qt6_add_translations}{qt_add_translations()}
+*/
+
+/*!
+\page cmake-variable-qt-i18n-native-language.html
+\ingroup cmake-variables-qtcore
+
+\title QT_I18N_SOURCE_LANGUAGE
+\target cmake-variable-QT_I18N_SOURCE_LANGUAGE
+
+\summary {Specifies the language of translatable strings.}
+
+\cmakevariablesince 6.7
+
+Specifies the language of translatable strings in the source code.
+The language must be compatible with the string-based \l QLocale constructor.
+
+Together with \c{QT_I18N_TRANSLATED_LANGUAGES}, this variable is used to determine the
+names of \c{.ts} files for \l{qt6_add_translations}{qt_add_translations()}.
+
+This variable can be conveniently set with the
+\l {qt6_standard_project_setup}{qt_standard_project_setup()} command.
+
+\sa {qt6_standard_project_setup}{qt_standard_project_setup()}
+\sa {qt6_add_translations}{qt_add_translations()}
+*/
+
+/*!
+\page cmake-variable-qt-ios-launch-screen.html
+\ingroup cmake-variables-qtcore
+
+\title QT_IOS_LAUNCH_SCREEN
+\target cmake-variable-QT_IOS_LAUNCH_SCREEN
+
+\summary {Path to iOS launch screen storyboard used by all targets.}
+
+\cmakevariablesince 6.4
+\preliminarycmakevariable
+\cmakevariableiosonly
+
+Specifies the path to an iOS launch screen storyboard file that will be used
+by all targets within a project.
+
+\sa {Launch Screens and Launch Images}
+*/
diff --git a/src/corelib/doc/src/cmake/cmake-deploy-variables.qdoc b/src/corelib/doc/src/cmake/cmake-deploy-variables.qdoc
index b10de9dc3b..ac5094e7cb 100644
--- a/src/corelib/doc/src/cmake/cmake-deploy-variables.qdoc
+++ b/src/corelib/doc/src/cmake/cmake-deploy-variables.qdoc
@@ -8,7 +8,7 @@
**/
/*!
-\page cmake-variable-QT_DEPLOY_PREFIX.html
+\page cmake-variable-qt-deploy-prefix.html
\ingroup cmake-variables-qtcore
\title QT_DEPLOY_PREFIX
@@ -19,7 +19,6 @@
\include cmake-deploy-var-usage.qdocinc
\cmakevariablesince 6.3
-\preliminarycmakevariable
\c{QT_DEPLOY_PREFIX} provides the base deployment directory. The other
\c{QT_DEPLOY_..._DIR} variables should be treated as relative to this location.
@@ -48,12 +47,13 @@ scripts should assume that the working directory is already set to the base
install location and just use the prefix-relative \c{QT_DEPLOY_..._DIR}
variables.
-\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR,
- QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR
+\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIBEXEC_DIR,
+ QT_DEPLOY_LIB_DIR, QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR,
+ QT_DEPLOY_TRANSLATIONS_DIR
*/
/*!
-\page cmake-variable-QT_DEPLOY_BIN_DIR.html
+\page cmake-variable-qt-deploy-bin-dir.html
\ingroup cmake-variables-qtcore
\title QT_DEPLOY_BIN_DIR
@@ -64,7 +64,6 @@ variables.
\include cmake-deploy-var-usage.qdocinc
\cmakevariablesince 6.3
-\preliminarycmakevariable
Projects should use \c QT_DEPLOY_BIN_DIR in their deploy scripts to avoid
hard-coding a particular directory in which to deploy the following types of
@@ -89,12 +88,51 @@ should not be used for that scenario.
\include cmake-deploy-runtime-dependencies.qdocinc
-\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_LIB_DIR,
- QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR
+\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_LIBEXEC_DIR,
+ QT_DEPLOY_LIB_DIR, QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR,
+ QT_DEPLOY_TRANSLATIONS_DIR
*/
/*!
-\page cmake-variable-QT_DEPLOY_LIB_DIR.html
+\page cmake-variable-qt-deploy-libexec-dir.html
+\ingroup cmake-variables-qtcore
+
+\title QT_DEPLOY_LIBEXEC_DIR
+\target cmake-variable-QT_DEPLOY_LIBEXEC_DIR
+
+\summary {Prefix-relative subdirectory for deploying program executables on some target platforms.}
+
+\include cmake-deploy-var-usage.qdocinc
+
+\cmakevariablesince 6.7
+
+On Unix derivatives, projects should use \c QT_DEPLOY_LIBEXEC_DIR in their
+deploy scripts to avoid hard-coding a particular directory in which to deploy
+helper executables that are local to the project.
+
+For example, projects using QtWebEngine would deploy the \c QtWebEngineProcess
+executable to this directory.
+
+\c QT_DEPLOY_LIBEXEC_DIR defaults to the value of \c${CMAKE_INSTALL_LIBEXECDIR}
+(usually \c{libexec}), which is provided by CMake's \l{GNUInstallDirs} module.
+To change the value of \c QT_DEPLOY_LIBEXEC_DIR, ensure that the project sets
+\c{CMAKE_INSTALL_LIBEXECDIR} before the \c Core package is found.
+
+The \c QT_DEPLOY_LIBEXEC_DIR path is relative to \l{QT_DEPLOY_PREFIX}.
+
+This variable is not meaningful when deploying into a macOS app bundle and
+should not be used for that scenario.
+
+\section1 Example
+
+\include cmake-deploy-modified-variable-values.qdocinc
+
+\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR,
+ QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR, QT_DEPLOY_TRANSLATIONS_DIR
+*/
+
+/*!
+\page cmake-variable-qt-deploy-lib-dir.html
\ingroup cmake-variables-qtcore
\title QT_DEPLOY_LIB_DIR
@@ -105,7 +143,6 @@ should not be used for that scenario.
\include cmake-deploy-var-usage.qdocinc
\cmakevariablesince 6.3
-\preliminarycmakevariable
Projects should use \c QT_DEPLOY_LIB_DIR in their deploy scripts to avoid
hard-coding a particular directory in which to deploy the following types of
@@ -132,11 +169,11 @@ should not be used for that scenario.
\include cmake-deploy-modified-variable-values.qdocinc
\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR,
- QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR
+ QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR, QT_DEPLOY_TRANSLATIONS_DIR
*/
/*!
-\page cmake-variable-QT_DEPLOY_PLUGINS_DIR.html
+\page cmake-variable-qt-deploy-plugins-dir.html
\ingroup cmake-variables-qtcore
\title QT_DEPLOY_PLUGINS_DIR
@@ -147,7 +184,6 @@ should not be used for that scenario.
\include cmake-deploy-var-usage.qdocinc
\cmakevariablesince 6.3
-\preliminarycmakevariable
Projects should use \c QT_DEPLOY_PLUGINS_DIR in their deploy scripts to avoid
hard-coding a particular directory under which to deploy plugins.
@@ -167,12 +203,13 @@ bundle contents.
\include cmake-deploy-modified-variable-values.qdocinc
-\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR,
- QT_DEPLOY_QML_DIR
+\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR,
+ QT_DEPLOY_LIBEXEC_DIR, QT_DEPLOY_LIB_DIR, QT_DEPLOY_QML_DIR,
+ QT_DEPLOY_TRANSLATIONS_DIR
*/
/*!
-\page cmake-variable-QT_DEPLOY_QML_DIR.html
+\page cmake-variable-qt-deploy-qml-dir.html
\ingroup cmake-variables-qtcore
\title QT_DEPLOY_QML_DIR
@@ -183,7 +220,6 @@ bundle contents.
\include cmake-deploy-var-usage.qdocinc
\cmakevariablesince 6.3
-\preliminarycmakevariable
Projects should use \c QT_DEPLOY_QML_DIR in their deploy scripts to avoid
hard-coding a particular directory under which to deploy QML modules.
@@ -205,6 +241,67 @@ to be deployed to different locations within the app bundle.
\include cmake-deploy-modified-variable-values.qdocinc
+\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR,
+ QT_DEPLOY_LIBEXEC_DIR, QT_DEPLOY_LIB_DIR, QT_DEPLOY_PLUGINS_DIR,
+ QT_DEPLOY_TRANSLATIONS_DIR
+*/
+
+/*!
+\page cmake-variable-qt-deploy-translations-dir.html
+\ingroup cmake-variables-qtcore
+
+\title QT_DEPLOY_TRANSLATIONS_DIR
+\target cmake-variable-QT_DEPLOY_TRANSLATIONS_DIR
+
+\summary {Prefix-relative subdirectory for deploying Qt translations on some target platforms.}
+
+\include cmake-deploy-var-usage.qdocinc
+
+\cmakevariablesince 6.5
+
+Projects should use \c QT_DEPLOY_TRANSLATIONS_DIR in their deploy scripts to
+avoid hard-coding a particular directory under which to deploy translations.
+
+\c QT_DEPLOY_TRANSLATIONS_DIR defaults to the value \c{translations}. To change
+the value of \c QT_DEPLOY_TRANSLATIONS_DIR, set it in the project deployment
+script before \c QT_DEPLOY_SUPPORT is included.
+
+The \c QT_DEPLOY_TRANSLATIONS_DIR path is relative to \l{QT_DEPLOY_PREFIX}.
+
+This variable is not meaningful when deploying on macOS or Windows.
+
+\section1 Example
+
+\include cmake-deploy-modified-variable-values.qdocinc
+
\sa QT_DEPLOY_SUPPORT, QT_DEPLOY_PREFIX, QT_DEPLOY_BIN_DIR, QT_DEPLOY_LIB_DIR,
- QT_DEPLOY_PLUGINS_DIR
+ QT_DEPLOY_LIBEXEC_DIR, QT_DEPLOY_PLUGINS_DIR, QT_DEPLOY_QML_DIR
+*/
+
+/*!
+\page cmake-variable-qt-deploy-ignored-lib-dirs.html
+\ingroup cmake-variables-qtcore
+
+\title QT_DEPLOY_IGNORED_LIB_DIRS
+\target cmake-variable-QT_DEPLOY_IGNORED_LIB_DIRS
+
+\summary {Directories that are excluded from runtime dependencies search}
+
+\include cmake-deploy-var-usage.qdocinc
+
+\cmakevariablesince 6.5
+
+This variable contains a list of directories that are not taken into account
+when searching for runtime dependencies with \l{qt_deploy_runtime_dependencies}.
+
+Projects may alter this variable before calling
+\l{qt_deploy_runtime_dependencies} to control from which directory runtime
+dependencies are deployed.
+
+This variable is ignored if the \c{POST_EXCLUDE_REGEXES} option is specified in
+the \l{qt_deploy_runtime_dependencies} call.
+
+This variable is not meaningful when deploying on macOS or Windows.
+
+\sa qt_deploy_runtime_dependencies
*/
diff --git a/src/corelib/doc/src/cmake/cmake-properties.qdoc b/src/corelib/doc/src/cmake/cmake-properties.qdoc
index bbb948aec2..8fe2b0e88f 100644
--- a/src/corelib/doc/src/cmake/cmake-properties.qdoc
+++ b/src/corelib/doc/src/cmake/cmake-properties.qdoc
@@ -4,6 +4,7 @@
/*!
\group cmake-target-properties-qtcore
\title CMake Target Properties in Qt6 Core
+\brief Lists CMake target properties known to Qt6::Core.
\l{CMake Commands in Qt6 Core}{CMake Commands} know about the following CMake
target properties:
@@ -12,9 +13,10 @@ target properties:
*/
/*!
-\page cmake-target-property-QT_ANDROID_DEPLOYMENT_DEPENDENCIES.html
+\page cmake-target-property-qt-android-deployment-dependencies.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
+\ingroup cmake-android-build-properties
\title QT_ANDROID_DEPLOYMENT_DEPENDENCIES
\target cmake-target-property-QT_ANDROID_DEPLOYMENT_DEPENDENCIES
@@ -43,9 +45,10 @@ is listed before its dependencies, it will fail to load on some devices.
*/
/*!
-\page cmake-target-property-QT_ANDROID_EXTRA_LIBS.html
+\page cmake-target-property-qt-android-extra-libs.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
+\ingroup cmake-android-build-properties
\title QT_ANDROID_EXTRA_LIBS
\target cmake-target-property-QT_ANDROID_EXTRA_LIBS
@@ -61,13 +64,64 @@ A list of external libraries that will be copied into your application's
to enable OpenSSL in your application. For more information, see
\l{Adding OpenSSL Support for Android}.
+When adding extra libraries from the build tree of your project, it's also
+necessary to add dependency relations between library and the application
+target. Using the following project structure may cause an issue, when deploying
+an apk:
+\badcode
+qt_add_executable(MyApp main.cpp)
+
+set_target_properties(MyApp PROPERTIES
+ QT_ANDROID_EXTRA_LIBS
+ ${CMAKE_CURRENT_BINARY_DIR}/libMyService_${ANDROID_ABI}.so
+)
+
+# MyService library doesn't have any relations with MyApp
+qt_add_library(MyService service.cpp)
+\endcode
+
+This leads to uncertainty whether MyService library will be available before
+the deployment of MyApp or not. The easiest solution is adding MyService
+library to the MyApp dependencies:
+\badcode
+add_dependencies(MyApp MyService)
+\endcode
+
+When adding per-architecture libraries to a multi-abi project,
+list all their paths explicitly, rather than rely on variables like
+\c CMAKE_ANDROID_ARCH_ABI to dynamically compute the paths.
+
+Prefer:
+
+\badcode
+set(libs
+ ${CMAKE_CURRENT_BINARY_DIR}/libA_x86so
+ ${CMAKE_CURRENT_BINARY_DIR}/libA_x86_64.so
+ ${CMAKE_CURRENT_BINARY_DIR}/libA_arm64-v8a.so
+ ${CMAKE_CURRENT_BINARY_DIR}/libA_armeabi-v7a.so
+)
+set_target_properties(MyApp PROPERTIES QT_ANDROID_EXTRA_LIBS ${libs})
+
+# When targeting precompiled libs
+target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC libA_${ANDROID_ABI})
+\endcode
+
+over:
+
+\badcode
+set_target_properties(MyApp PROPERTIES
+ QT_ANDROID_EXTRA_LIBS
+ ${CMAKE_CURRENT_BINARY_DIR}/libA_${CMAKE_ANDROID_ARCH_ABI}.so)
+\endcode
+
\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
*/
/*!
-\page cmake-target-property-QT_ANDROID_EXTRA_PLUGINS.html
+\page cmake-target-property-qt-android-extra-plugins.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
+\ingroup cmake-android-build-properties
\title QT_ANDROID_EXTRA_PLUGINS
\target cmake-target-property-QT_ANDROID_EXTRA_PLUGINS
@@ -96,9 +150,10 @@ mangling is applied to the plugin library.
*/
/*!
-\page cmake-target-property-QT_ANDROID_MIN_SDK_VERSION.html
+\page cmake-target-property-qt-android-min-sdk-version.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
+\ingroup cmake-android-build-properties
\title QT_ANDROID_MIN_SDK_VERSION
\target cmake-target-property-QT_ANDROID_MIN_SDK_VERSION
@@ -115,9 +170,10 @@ Specifies the minimum Android API level for the target.
*/
/*!
-\page cmake-target-property-QT_ANDROID_PACKAGE_SOURCE_DIR.html
+\page cmake-target-property-qt-android-package-source-dir.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
+\ingroup cmake-android-build-properties
\title QT_ANDROID_PACKAGE_SOURCE_DIR
\target cmake-target-property-QT_ANDROID_PACKAGE_SOURCE_DIR
@@ -148,9 +204,10 @@ then place this directly into the directory specified by this variable.
*/
/*!
-\page cmake-target-property-QT_ANDROID_TARGET_SDK_VERSION.html
+\page cmake-target-property-qt-android-target-sdk-version.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
+\ingroup cmake-android-build-properties
\title QT_ANDROID_TARGET_SDK_VERSION
\target cmake-target-property-QT_ANDROID_TARGET_SDK_VERSION
@@ -167,12 +224,34 @@ Specifies the target Android API level for the target.
*/
/*!
-\page cmake-target-property-QT_ANDROID_VERSION_CODE.html
+\page cmake-target-property-qt-android-sdk-build-tools-revision.html
+\ingroup cmake-properties-qtcore
+\ingroup cmake-target-properties-qtcore
+\ingroup cmake-android-build-properties
+
+\title QT_ANDROID_SDK_BUILD_TOOLS_REVISION
+\target cmake-target-property-QT_ANDROID_SDK_BUILD_TOOLS_REVISION
+
+\summary {Revision of Android build tools to use.}
+
+\cmakepropertysince 6.0
+\preliminarycmakeproperty
+\cmakepropertyandroidonly
+
+Specifies the Android SDK build tools revision to use. If this is not set then
+CMake will attempt to use the latest installed version.
+
+\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
+*/
+
+/*!
+\page cmake-target-property-qt-android-version-code.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
\title QT_ANDROID_VERSION_CODE
\target cmake-target-property-QT_ANDROID_VERSION_CODE
+\ingroup cmake-android-manifest-properties
\summary {Internal Android app version.}
@@ -189,12 +268,13 @@ For more information, see \l{Android: App Versioning}{Android App Versioning}.
*/
/*!
-\page cmake-target-property-QT_ANDROID_VERSION_NAME.html
+\page cmake-target-property-qt-android-version-name.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
\title QT_ANDROID_VERSION_NAME
\target cmake-target-property-QT_ANDROID_VERSION_NAME
+\ingroup cmake-android-manifest-properties
\summary {Human-readable Android app version.}
@@ -211,9 +291,10 @@ For more information, see \l{Android: App Versioning}{Android App Versioning}.
*/
/*!
-\page cmake-target-property-QT_ANDROID_ABIS.html
+\page cmake-target-property-qt-android-abis.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
+\ingroup cmake-android-build-properties
\title QT_ANDROID_ABIS
\target cmake-target-property-QT_ANDROID_ABIS
@@ -234,7 +315,7 @@ The property only affects targets created with
*/
/*!
-\page cmake-target-property-QT_QML_ROOT_PATH.html
+\page cmake-target-property-qt-qml-root-path.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
@@ -255,7 +336,7 @@ will be used instead.
*/
/*!
-\page cmake-target-property-QT_QML_IMPORT_PATH.html
+\page cmake-target-property-qt-qml-import-path.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
@@ -277,9 +358,10 @@ For application-specific QML imports, use
*/
/*!
-\page cmake-target-property-QT_ANDROID_DEPLOYMENT_SETTINGS_FILE.html
+\page cmake-target-property-qt-android-deployment-settings-file.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
+\ingroup cmake-android-build-properties
\title QT_ANDROID_DEPLOYMENT_SETTINGS_FILE
\target cmake-target-property-QT_ANDROID_DEPLOYMENT_SETTINGS_FILE
@@ -297,9 +379,10 @@ and overwritten by that command.
*/
/*!
-\page cmake-target-property-QT_ANDROID_SYSTEM_LIBS_PREFIX.html
+\page cmake-target-property-qt-android-system-libs-prefix.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
+\ingroup cmake-android-build-properties
\title QT_ANDROID_SYSTEM_LIBS_PREFIX
\target cmake-target-property-QT_ANDROID_SYSTEM_LIBS_PREFIX
@@ -314,9 +397,10 @@ when those libraries are installed outside app's native (JNI) library directory.
*/
/*!
-\page cmake-target-property-QT_ANDROID_NO_DEPLOY_QT_LIBS.html
+\page cmake-target-property-qt-android-no-deploy-qt-libs.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
+\ingroup cmake-android-build-properties
\title QT_ANDROID_NO_DEPLOY_QT_LIBS
\target cmake-target-property-QT_ANDROID_NO_DEPLOY_QT_LIBS
@@ -336,7 +420,7 @@ instead.
*/
/*!
-\page cmake-target-property-qt_no_entrypoint.html
+\page cmake-target-property-qt-no-entrypoint.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
@@ -355,7 +439,7 @@ On targets that must provide their own entry point, set the property \c qt_no_en
*/
/*!
-\page cmake-target-property-qt_resource_prefix.html
+\page cmake-target-property-qt-resource-prefix.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
@@ -375,6 +459,7 @@ resource prefix.
/*!
\group cmake-source-file-properties-qtcore
\title CMake Source File Properties in Qt6 Core
+\brief Lists CMake file properties used in Qt6::Core.
\l{CMake Commands in Qt6 Core}{CMake Commands} know about the following CMake
source file properties:
@@ -383,7 +468,7 @@ source file properties:
*/
/*!
-\page cmake-source-file-property-QT_RESOURCE_ALIAS.html
+\page cmake-source-file-property-qt-resource-alias.html
\ingroup cmake-source-file-properties-qtcore
\title QT_RESOURCE_ALIAS
@@ -392,7 +477,6 @@ source file properties:
\summary {Specifies the Qt resource alias for a file in a resource.}
\cmakepropertysince 6.0
-\preliminarycmakeproperty
When using the target-based variant of \l{qt6_add_resources}{qt_add_resources}
the property value overrides the runtime path where the resource file is found.
@@ -401,7 +485,34 @@ the property value overrides the runtime path where the resource file is found.
*/
/*!
-\page cmake-target-property-QT_WASM_PTHREAD_POOL_SIZE.html
+\page cmake-source-file-property-qt-discard-file-contents.html
+\ingroup cmake-source-file-properties-qtcore
+
+\title QT_DISCARD_FILE_CONTENTS
+\target cmake-source-file-property-QT_DISCARD_FILE_CONTENTS
+
+\summary {Specifies that the given files should be empty in the resource file system}
+
+\cmakepropertysince 6.6
+\preliminarycmakeproperty
+
+When using the target-based variant of \l{qt6_add_resources}{qt_add_resources}
+or \l{qt_add_qml_module}, setting this property to \c TRUE causes the file
+contents to be omitted when creating the resource file system. The file name is
+retained.
+
+This is useful if you want to strip QML source code from the binary.
+
+\note If you omit the QML source code from the binary, the QML engine has to
+rely on the compilation units created by \l{qmlcachegen} or \l{qmlsc}.
+Those are tied to the specific version of Qt they were built with. If you change
+the version of Qt your application uses, they can't be loaded anymore.
+
+\sa{The Qt Resource System}
+*/
+
+/*!
+\page cmake-target-property-qt-wasm-pthread-pool-size.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
@@ -425,7 +536,44 @@ For more information, see \l{https://emscripten.org/docs/porting/pthreads.html}{
*/
/*!
-\page cmake-target-property-QT_WASM_INITIAL_MEMORY.html
+\group cmake-global-properties-qtcore
+\title CMake Global Properties in Qt6 Core
+\brief Lists CMake global properties used or defined in Qt6::Core.
+
+\l{CMake Commands in Qt6 Core}{CMake Commands} know about the following global
+CMake properties:
+
+\sa{CMake Property Reference}
+*/
+
+/*!
+\page cmake-global-property-qt-targets-folder.html
+\ingroup cmake-properties-qtcore
+\ingroup cmake-global-properties-qtcore
+
+\title QT_TARGETS_FOLDER
+\target cmake-global-property-QT_TARGETS_FOLDER
+
+\brief Sets the FOLDER property for Qt-internal targets.
+
+\cmakepropertysince 6.5
+\preliminarycmakeproperty
+
+Name of the \l FOLDER for internal targets that are added by Qt's CMake
+commands.
+
+By default, this property is not set.
+
+This property only has an effect if CMake's \l USE_FOLDERS property is \c{ON}.
+
+You can use the \l{qt6_standard_project_setup}{qt_standard_project_setup}
+function to enable folder support and initialize the \c{QT_TARGETS_FOLDER}.
+
+\sa{qt6_standard_project_setup}{qt_standard_project_setup}
+*/
+
+/*!
+\page cmake-target-property-qt-wasm-initial-memory.html
\ingroup cmake-properties-qtcore
\ingroup cmake-target-properties-qtcore
@@ -445,3 +593,45 @@ QT_WASM_INITIAL_MEMORY must be a multiple of 65536 bytes.
For more information, see \l{https://github.com/emscripten-core/emscripten/blob/main/src/settings.js}{Emscripten compiler settings}.
*/
+
+/*!
+\page cmake-target-property-qt-wasm-maximum-memory.html
+\ingroup cmake-properties-qtcore
+\ingroup cmake-target-properties-qtcore
+
+\title QT_WASM_MAXIMUM_MEMORY
+\target cmake-target-property-QT_WASM_MAXIMUM_MEMORY
+
+\summary {Internal WebAssembly maximum memory.}
+
+\cmakepropertysince 6.7
+\preliminarycmakeproperty
+\cmakepropertywebassemblyonly
+
+Specifies the maximum amount of memory the application can use. Translates into
+the Emscripten compiler setting of \c MAXIMUM_MEMORY. The default value
+is 4GB, which is the maximum for 32-bit WebAssembly.
+
+For more information, see the \l{https://github.com/emscripten-core/emscripten/blob/3319a313d3b589624d342b650884caaf8cd9ef30/src/settings.js#L187}{Emscripten compiler settings}.
+*/
+
+
+
+/*!
+\page cmake-target-property-qt-ios-launch-screen.html
+\ingroup cmake-properties-qtcore
+\ingroup cmake-target-properties-qtcore
+
+\title QT_IOS_LAUNCH_SCREEN
+\target cmake-target-property-QT_IOS_LAUNCH_SCREEN
+
+\summary {Path to iOS launch screen storyboard}
+
+\cmakepropertysince 6.4
+\preliminarycmakeproperty
+\cmakepropertyiosonly
+
+Specifies the path to an iOS launch screen storyboard file.
+
+\sa {Launch Screens and Launch Images}
+*/
diff --git a/src/corelib/doc/src/cmake/cmake-standard-properties.qdoc b/src/corelib/doc/src/cmake/cmake-standard-properties.qdoc
new file mode 100644
index 0000000000..a8ece6ba8f
--- /dev/null
+++ b/src/corelib/doc/src/cmake/cmake-standard-properties.qdoc
@@ -0,0 +1,24 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+\page cmake-standard-property-autogen-better-graph-multi-config.html
+\ingroup cmake-standard-properties
+
+\title AUTOGEN_BETTER_GRAPH_MULTI_CONFIG
+
+\brief Improves the dependency graph for multi-configuration generators when you
+set it on a target.
+
+When this boolean property is enabled, \c{CMake} will generate more per-config targets.
+Thus, the dependency graph will be more accurate for multi-configuration
+generators and some recompilations will be avoided.
+
+Since Qt 6.8, this property is enabled by default. For older versions,
+you need to enable it manually to use it.
+However, \l{qt_extract_metatypes} and \l{qt_add_qml_module} were updated to
+support \c{AUTOGEN_BETTER_GRAPH_MULTI_CONFIG} in Qt 6.8, so you will get build
+errors, unless you patch the older Qt version to support it.
+
+See \l{https://cmake.org/cmake/help/latest/prop_tgt/AUTOGEN_BETTER_GRAPH_MULTI_CONFIG.html}{AUTOGEN_BETTER_GRAPH_MULTI_CONFIG} for more information.
+*/
diff --git a/src/corelib/doc/src/cmake/policy/qtp0002.qdoc b/src/corelib/doc/src/cmake/policy/qtp0002.qdoc
new file mode 100644
index 0000000000..a40344a167
--- /dev/null
+++ b/src/corelib/doc/src/cmake/policy/qtp0002.qdoc
@@ -0,0 +1,63 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+\page qt-cmake-policy-qtp0002.html
+\ingroup qt-cmake-policies
+
+\title QTP0002
+\keyword qt_cmake_policy_qtp0002
+
+\summary {Target properties that specify Android-specific paths may contain generator expressions.}
+
+This policy was introduced in Qt 6.6. It changes the processing of target
+properties that specify Android-specific paths:
+\list
+ \li \l QT_QML_IMPORT_PATH
+ \li \l QT_QML_ROOT_PATH
+ \li \l QT_ANDROID_PACKAGE_SOURCE_DIR
+ \li \l QT_ANDROID_EXTRA_PLUGINS
+ \li \l QT_ANDROID_EXTRA_LIBS
+\endlist
+
+The \c OLD behavior of this policy doesn't allow generator expressions in the
+target properties that specify Android-specific paths but implicitly converts
+the specified paths to valid JSON strings.
+
+The \c NEW behavior of this policy allows using generator expressions in the
+target properties that specify Android-specific paths, but they must evaluate to
+valid JSON strings.
+
+The following value of the \l QT_ANDROID_EXTRA_PLUGINS property is converted to
+a valid JSON string if you set the policy to OLD, but leads to an error if the
+policy is set to NEW:
+\badcode
+set_target_properties(
+ QT_ANDROID_EXTRA_PLUGINS "\\path\\to\\MyPlugin.so"
+)
+\endcode
+If the policy is set to NEW for the above example, the resulting JSON string in
+the deployment settings file will contain escaped symbols instead of path
+separators.
+
+Generator expressions are only supported if the policy is set to NEW, so the
+OLD behavior generates a malformed deployment settings file with the following
+code:
+\badcode
+set_target_properties(
+ QT_ANDROID_EXTRA_PLUGINS "$<TARGET_FILE_DIR:MyPlugin>"
+)
+\endcode
+
+This property value works as expected with both OLD and NEW policy values:
+\badcode
+set_target_properties(
+ QT_ANDROID_EXTRA_PLUGINS "/path/to/MyPlugin.so"
+)
+\endcode
+
+\qtpolicydeprecatedbehavior
+
+\sa qt_policy, {Qt CMake policies}
+
+*/
diff --git a/src/corelib/doc/src/cmake/policy/qtp0003.qdoc b/src/corelib/doc/src/cmake/policy/qtp0003.qdoc
new file mode 100644
index 0000000000..bf11b6f8b5
--- /dev/null
+++ b/src/corelib/doc/src/cmake/policy/qtp0003.qdoc
@@ -0,0 +1,46 @@
+// Copyright (C) 2024 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+\page qt-cmake-policy-qtp0003.html
+\ingroup qt-cmake-policies
+\since 6.7
+\title QTP0003
+\keyword qt_cmake_policy_qtp0003
+
+\summary {Consider the BUILD_SHARED_LIBS value when creating Qt libraries.}
+
+This policy was introduced in Qt 6.7. The policy affects the default type of the
+libraries created using \l {CMake Commands in Qt6 Core}{Qt CMake API}, like
+\l {qt_add_library}, \l{qt_add_plugin}, \l{qt_add_qml_module}.
+
+If the policy is set to \c OLD, the default library type that is selected is
+aligned with the Qt build type, either \c shared or \c static.
+
+If the policy is set to \c NEW, the library type is selected according to the
+\l {CMake BUILD_SHARED_LIBS Documentation}{BUILD_SHARED_LIBS} value if it's set.
+If \c BUILD_SHARED_LIBS is not set, the default library type falls back to the
+Qt build type.
+
+For example, the following code will use the Qt build type as the default
+library type for the \c MyLib target, despite the fact \c BUILD_SHARED_LIBS is
+set to \c ON:
+\badcode
+set(BUILD_SHARED_LIBS ON)
+...
+qt6_add_library(MyLib sourcefile.h sourcefile.cpp)
+\endcode
+
+If you set the QTP0003 to \c NEW before the \l {qt6_add_library}{qt_add_library}
+call, \c BUILD_SHARED_LIBS will affect the library default type and \c MyLib
+will be the shared library.
+\badcode
+set(BUILD_SHARED_LIBS ON)
+...
+qt_policy(SET QTP0003 NEW)
+qt6_add_library(MyLib sourcefile.h sourcefile.cpp)
+\endcode
+
+\sa qt_policy, {Qt CMake policies}, qt_add_library
+
+*/
diff --git a/src/corelib/doc/src/cmake/qt_add_big_resources.qdoc b/src/corelib/doc/src/cmake/qt_add_big_resources.qdoc
index 5ae7b9728b..8215d4c717 100644
--- a/src/corelib/doc/src/cmake/qt_add_big_resources.qdoc
+++ b/src/corelib/doc/src/cmake/qt_add_big_resources.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_add_bigresources.html
+\page qt-add-bigresources.html
\ingroup cmake-commands-qtcore
\title qt_add_big_resources
-\target qt6_add_big_resources
+\keyword qt6_add_big_resources
\summary {Compiles big binary resources into object code.}
diff --git a/src/corelib/doc/src/cmake/qt_add_binary_resources.qdoc b/src/corelib/doc/src/cmake/qt_add_binary_resources.qdoc
index a247b6d7c0..12ee5e1aff 100644
--- a/src/corelib/doc/src/cmake/qt_add_binary_resources.qdoc
+++ b/src/corelib/doc/src/cmake/qt_add_binary_resources.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_add_binary_resources.html
+\page qt-add-binary-resources.html
\ingroup cmake-commands-qtcore
\title qt_add_binary_resources
-\target qt6_add_binary_resources
+\keyword qt6_add_binary_resources
\summary {Creates an RCC file from a list of Qt resource files.}
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
*/
diff --git a/src/corelib/doc/src/cmake/qt_add_library.qdoc b/src/corelib/doc/src/cmake/qt_add_library.qdoc
index 52b85d0476..851a2d6210 100644
--- a/src/corelib/doc/src/cmake/qt_add_library.qdoc
+++ b/src/corelib/doc/src/cmake/qt_add_library.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_add_library.html
+\page qt-add-library.html
\ingroup cmake-commands-qtcore
\title qt_add_library
-\target qt6_add_library
+\keyword qt6_add_library
\summary {Creates and finalizes a library.}
@@ -45,12 +45,15 @@ library type created depends on how Qt was built. If Qt was built statically,
a static library will be created. Otherwise, a shared library will
be created. Note that this is different to how CMake's \c{add_library()}
command works, where the \c BUILD_SHARED_LIBS variable controls the type of
-library created. The \c{qt_add_library()} command does not consider
-\c BUILD_SHARED_LIBS when deciding the library type.
+library created.
+Since 6.7, the \c{qt_add_library()} command considers \c BUILD_SHARED_LIBS
+when deciding the library type only if the variable is set explicitly and
+\l {QTP0003} is set to \c NEW.
Any \c{sources} provided will be passed through to the internal call to
\c{add_library()}.
+\target qt_add_library finalization
\section2 Finalization
After a target is created, further processing or \e{finalization} steps may be
@@ -72,6 +75,6 @@ time. In general, \c MANUAL_FINALIZATION should not be needed unless the
project has to support CMake 3.18 or earlier.
\sa {qt6_finalize_target}{qt_finalize_target()},
- {qt6_add_executable}{qt_add_executable()}
+ {qt6_add_executable}{qt_add_executable()}, QTP0003
*/
diff --git a/src/corelib/doc/src/cmake/qt_add_plugin.qdoc b/src/corelib/doc/src/cmake/qt_add_plugin.qdoc
index e4bacc36a9..d2322086e7 100644
--- a/src/corelib/doc/src/cmake/qt_add_plugin.qdoc
+++ b/src/corelib/doc/src/cmake/qt_add_plugin.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_add_plugin.html
+\page qt-add-plugin.html
\ingroup cmake-commands-qtcore
\title qt_add_plugin
-\target qt6_add_plugin
+\keyword qt6_add_plugin
\summary {Creates a Qt plugin target.}
@@ -21,10 +21,14 @@ qt_add_plugin(target
[SHARED | STATIC]
[CLASS_NAME class_name]
[OUTPUT_TARGETS variable_name]
+ [MANUAL_FINALIZATION]
sources...
)
\endcode
+The \c MANUAL_FINALIZATION option and the ability to set sources
+were introduced in Qt 6.5.
+
\versionlessCMakeCommandsNote qt6_add_plugin()
\section1 Description
@@ -67,4 +71,17 @@ project should also install these internal targets. The names of these targets
can be obtained by providing the \c OUTPUT_TARGETS option, followed by the name
of a variable in which to return the target list.
+\section2 Finalization
+
+After a target is created, further processing or \e{finalization} steps may be
+needed. The finalization processing is implemented by the
+\l{qt6_finalize_target}{qt_finalize_target()} command.
+
+For details and the meaning of the \c{MANUAL_FINALIZATION} option, refer to the
+\l{qt_add_library finalization}{finalization documentation} for
+\c{qt_add_library}.
+
+\sa {qt6_finalize_target}{qt_finalize_target()},
+ {qt6_add_executable}{qt_add_executable()}
+
*/
diff --git a/src/corelib/doc/src/cmake/qt_add_resources.qdoc b/src/corelib/doc/src/cmake/qt_add_resources.qdoc
index 7de9b94854..2e713b1b8e 100644
--- a/src/corelib/doc/src/cmake/qt_add_resources.qdoc
+++ b/src/corelib/doc/src/cmake/qt_add_resources.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_add_resources.html
+\page qt-add-resources.html
\ingroup cmake-commands-qtcore
\title qt_add_resources
-\target qt6_add_resources
+\keyword qt6_add_resources
\summary {Compiles binary resources into source code.}
@@ -28,6 +28,7 @@ qt_add_resources(<TARGET> <RESOURCE_NAME>
[PREFIX <PATH>]
[LANG <LANGUAGE>]
[BASE <PATH>]
+ [BIG_RESOURCES]
[OUTPUT_TARGETS <VARIABLE_NAME>]
[FILES ...] [OPTIONS ...])
\endcode
@@ -47,8 +48,6 @@ When passing a target as first argument, the function creates a resource with
the name \c{RESOURCE_NAME}, containing the specified \c{FILES}. The resource is
automatically linked into \c{TARGET}.
-For embedding bigger resources, see \l qt_add_big_resources.
-
See \l{The Qt Resource System} for a general description of Qt resources.
\section1 Arguments of the target-based variant
@@ -56,7 +55,9 @@ See \l{The Qt Resource System} for a general description of Qt resources.
\c PREFIX specifies a path prefix under which all files of this resource are
accessible from C++ code. This corresponds to the XML attribute \c prefix of the
\c .qrc file format. If \c PREFIX is not given, the target property
-\l{cmake-target-property-QT_RESOURCE_PREFIX}{QT_RESOURCE_PREFIX} is used.
+\l{cmake-target-property-QT_RESOURCE_PREFIX}{QT_RESOURCE_PREFIX} is used. Since
+6.5, \c{PREFIX} is optional. If it is omitted and not specified by
+\c{QT_RESOURCE_PREFIX}, \c{"/"} will be used as the default path prefix.
\c LANG specifies the locale of this resource. This corresponds to the XML
attribute \c lang of the \c .qrc file format.
@@ -69,6 +70,16 @@ example, if \c BASE is \c{"assets"} and \c FILES is
Alias settings for files need to be set via the \c QT_RESOURCE_ALIAS source file
property.
+\c BIG_RESOURCES can be specified to enable support for big resources. This
+directly generates object files (\c .o, \c .obj) instead of C++ source code.
+This allows embedding bigger resources, without having to compile generated C++
+sources, which can be too time consuming and memory intensive.
+
+Note that \c BIG_RESOURCES is not compatible with iOS due to restrictions of
+CMake's Xcode project generator. See
+\l{https://bugreports.qt.io/browse/QTBUG-103497}{QTBUG-103497} for details.
+Also, \c BIG_RESOURCES only works reliably from CMake 3.17 onwards.
+
When using this command with static libraries, one or more special targets will
be generated. Should you wish to perform additional processing on these targets,
pass a variable name to the \c OUTPUT_TARGETS parameter. The \c qt_add_resources
@@ -94,4 +105,6 @@ resources linked into the final target.
This especially affects static builds. There, the same resource name in
different static libraries conflict in the consuming target.
+
+\sa {qt6_add_big_resources}{qt_add_big_resources()}
*/
diff --git a/src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc b/src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc
index 8219380bd5..ad95401f4d 100644
--- a/src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc
+++ b/src/corelib/doc/src/cmake/qt_allow_non_utf8_sources.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_allow_non_utf8_sources.html
+\page qt-allow-non-utf8-sources.html
\ingroup cmake-commands-qtcore
\title qt_allow_non_utf8_sources
-\target qt6_allow_non_utf8_sources
+\keyword qt6_allow_non_utf8_sources
\summary {Prevents forcing source files to be treated as UTF-8 for Windows.}
diff --git a/src/corelib/doc/src/cmake/qt_android_add_apk_target.qdoc b/src/corelib/doc/src/cmake/qt_android_add_apk_target.qdoc
index 7818596c76..b2415730f5 100644
--- a/src/corelib/doc/src/cmake/qt_android_add_apk_target.qdoc
+++ b/src/corelib/doc/src/cmake/qt_android_add_apk_target.qdoc
@@ -2,18 +2,18 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_android_add_apk_target.html
+\page qt-android-add-apk-target.html
\ingroup cmake-commands-qtcore
\title qt_android_add_apk_target
-\target qt6_android_add_apk_target
+\keyword qt6_android_add_apk_target
\summary {Defines a build target that runs androiddeployqt to produce an APK.}
\include cmake-find-package-core.qdocinc
\cmakecommandsince 6.0
-\preliminarycmakecommand
+\warning This command is deprecated since Qt 6.5. Use \l qt_add_executable instead.
\cmakecommandandroidonly
\section1 Synopsis
diff --git a/src/corelib/doc/src/cmake/qt_android_apply_arch_suffix.qdoc b/src/corelib/doc/src/cmake/qt_android_apply_arch_suffix.qdoc
index 5451a6727c..a29e1f6123 100644
--- a/src/corelib/doc/src/cmake/qt_android_apply_arch_suffix.qdoc
+++ b/src/corelib/doc/src/cmake/qt_android_apply_arch_suffix.qdoc
@@ -2,18 +2,19 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_android_apply_arch_suffix.html
+\page qt-android-apply-arch-suffix.html
\ingroup cmake-commands-qtcore
\title qt_android_apply_arch_suffix
-\target qt6_android_apply_arch_suffix
+\keyword qt6_android_apply_arch_suffix
\summary {Configures the target binary's name to include an architecture-specific suffix.}
\include cmake-find-package-core.qdocinc
\cmakecommandsince 6.0
-\preliminarycmakecommand
+\warning This command is deprecated since Qt 6.5. Use \l qt_add_executable
+or \l qt_add_library instead.
\cmakecommandandroidonly
\section1 Synopsis
diff --git a/src/corelib/doc/src/cmake/qt_android_generate_deployment_settings.qdoc b/src/corelib/doc/src/cmake/qt_android_generate_deployment_settings.qdoc
index 4df3a32101..5a7bbdc33f 100644
--- a/src/corelib/doc/src/cmake/qt_android_generate_deployment_settings.qdoc
+++ b/src/corelib/doc/src/cmake/qt_android_generate_deployment_settings.qdoc
@@ -2,18 +2,18 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_android_generate_deployment_settings.html
+\page qt-android-generate-deployment-settings.html
\ingroup cmake-commands-qtcore
\title qt_android_generate_deployment_settings
-\target qt6_android_generate_deployment_settings
+\keyword qt6_android_generate_deployment_settings
\summary {Generates the deployment settings file needed by androiddeployqt.}
\include cmake-find-package-core.qdocinc
\cmakecommandsince 6.0
-\preliminarycmakecommand
+\warning This command is deprecated since Qt 6.5. Use \l qt_add_executable instead.
\cmakecommandandroidonly
\section1 Synopsis
diff --git a/src/corelib/doc/src/cmake/qt_deploy_qt_conf.qdoc b/src/corelib/doc/src/cmake/qt_deploy_qt_conf.qdoc
index 4f2b638835..45fd8f4c5f 100644
--- a/src/corelib/doc/src/cmake/qt_deploy_qt_conf.qdoc
+++ b/src/corelib/doc/src/cmake/qt_deploy_qt_conf.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_deploy_qt_conf.html
+\page qt-deploy-qt-conf.html
\ingroup cmake-commands-qtcore
\title qt_deploy_qt_conf
-\target qt_deploy_qt_conf
+\keyword qt6_deploy_qt_conf
\summary {Write a qt.conf file at deployment time.}
@@ -17,7 +17,6 @@ only be called from a deployment script. It cannot be called directly by the
project.
\cmakecommandsince 6.3
-\preliminarycmakecommand
\note This command does not usually need to be called directly. It is used
internally by other higher level commands, but projects wishing to
implement more customized deployment logic may find it useful.
@@ -58,16 +57,15 @@ variables can be used to dynamically specify a path relative to the deployment b
as shown in the example below. This helps avoid hard-coding an absolute path.
\sa {qt6_generate_deploy_app_script}{qt_generate_deploy_app_script()},
- qt_deploy_runtime_dependencies()
+ {qt6_deploy_runtime_dependencies}{qt_deploy_runtime_dependencies()}
\section1 Example
\badcode
# The following script must only be executed at install time
-set(deploy_script "${CMAKE_CURRENT_BINARY_DIR}/deploy_custom.cmake")
-
-file(GENERATE OUTPUT ${deploy_script} CONTENT "
-include(\"${QT_DEPLOY_SUPPORT}\")
+qt_generate_deploy_script(
+ OUTPUT_SCRIPT deploy_script
+ CONTENT "
qt_deploy_qt_conf(\"\${QT_DEPLOY_PREFIX}/\${QT_DEPLOY_BIN_DIR}/qt.conf\"
DATA_DIR \"./custom_data_dir\"
TRANSLATIONS_DIR \"./custom_translations_dir\"
diff --git a/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc b/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc
index 6f950b4020..f64960492a 100644
--- a/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc
+++ b/src/corelib/doc/src/cmake/qt_deploy_runtime_dependencies.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_deploy_runtime_dependencies.html
+\page qt-deploy-runtime-dependencies.html
\ingroup cmake-commands-qtcore
\title qt_deploy_runtime_dependencies
-\target qt_deploy_runtime_dependencies
+\keyword qt6_deploy_runtime_dependencies
\summary {Deploy Qt plugins, Qt and non-Qt libraries needed by an executable.}
@@ -17,7 +17,6 @@ can only be called from a deployment script. It cannot be called directly by the
project during the configure stage.
\cmakecommandsince 6.3
-\preliminarycmakecommand
\note This command does not usually need to be called directly. It is used
internally by other higher level commands, but projects wishing to
implement more customized deployment logic may find it useful.
@@ -32,12 +31,22 @@ qt_deploy_runtime_dependencies(
[ADDITIONAL_MODULES files...]
[GENERATE_QT_CONF]
[BIN_DIR bin_dir]
+ [LIBEXEC_DIR libexec_dir]
[LIB_DIR lib_dir]
[PLUGINS_DIR plugins_dir]
[QML_DIR qml_dir]
[VERBOSE]
[NO_OVERWRITE]
[NO_APP_STORE_COMPLIANCE]
+ [NO_TRANSLATIONS]
+ [NO_COMPILER_RUNTIME]
+ [DEPLOY_TOOL_OPTIONS]
+ [PRE_INCLUDE_REGEXES regexes...]
+ [PRE_EXCLUDE_REGEXES regexes...]
+ [POST_INCLUDE_REGEXES regexes...]
+ [POST_EXCLUDE_REGEXES regexes...]
+ [POST_INCLUDE_FILES files...]
+ [POST_EXCLUDE_FILES files...]
)
\endcode
@@ -47,22 +56,25 @@ When installing an application, it may be desirable to also install the
libraries and plugins it depends on. When the application is a macOS app bundle
or a Windows executable, \c{qt_deploy_runtime_dependencies()} can be called
from an install-time script to deploy those dependencies. It will install
-non-system libraries (both Qt and those provided by the project), plus an
-appropriate set of Qt plugins.
+non-system Qt libraries plus an appropriate set of Qt plugins.
+
+On Linux, the command will deploy additional libraries, beyond just those
+related to Qt, that are included with the project. However, when executed on
+macOS or Windows, the command will use either \c macdeployqt or \c windeployqt,
+which will only deploy libraries that are specific to Qt.
This command only considers runtime dependencies for which linking
relationships exist in the underlying binaries. It does not deploy QML modules,
-see \l{qt_deploy_qml_imports()} for that.
+see \l{qt6_deploy_qml_imports}{qt_deploy_qml_imports()} for that.
\section1 Arguments
The \c{EXECUTABLE} option must be provided.
-The \c{executable} argument should be a path to the executable file, relative to
-the base install location. For example, \c{bin/MyApp.exe}, or more dynamically
-\c{\${QT_DEPLOY_BIN_DIR}/$<TARGET_FILE_NAME:MyApp>}.
-Specifying raw target names not wrapped in a generator epxression like
-\c{<TARGET_FILE_NAME:>} is not supported.
+The \c{executable} argument should be the path to the executable file in the
+build directory. For example, \c{${CMAKE_CURRENT_BINARY_DIR}/MyApp.exe}, or more
+dynamically \c{$<TARGET_FILE:MyApp>}. Specifying raw target names not wrapped in
+a generator expression like \c{<TARGET_FILE:>} is not supported.
For macOS app bundles, the \c{executable} argument should be a path to the
bundle directory, relative to the base install location.
@@ -92,13 +104,41 @@ directory structure. If the \c{GENERATE_QT_CONF} option is given, an appropriate
\c{qt.conf} file will be written to the same directory as the \c{executable}.
The paths in that \c{qt.conf} file will be based on the \c{CMAKE_INSTALL_xxxDIR}
variables, whose defaults are provided by CMake's \l{GNUInstallDirs} module.
-You can override some of those defaults with the \c{BIN_DIR}, \c{LIB_DIR},
-\c{PLUGINS_DIR}, and \c{QML_DIR} options, all of which are expected to be
-relative to the base install location. A \c{qt.conf} file is always written if
-\c{executable} is a macOS app bundle, regardless of whether or not
-\c{GENERATE_QT_CONF} is provided. The \c{..._DIR} options are also ignored in
-that case, since the directory layout of an app bundle is dictated by Apple's
-requirements.
+
+You can override some of those defaults with the parameters in the following
+table, all of which are expected to be relative to the base install location.
+
+\table
+\header
+ \li parameter
+ \li affected variable
+ \li notes
+\row
+ \li \c BIN_DIR
+ \li \l QT_DEPLOY_BIN_DIR
+ \li
+\row
+ \li \c LIBEXEC_DIR
+ \li \l QT_DEPLOY_LIBEXEC_DIR
+ \li since Qt 6.7
+\row
+ \li \c LIB_DIR
+ \li \l QT_DEPLOY_LIB_DIR
+ \li
+\row
+ \li \c PLUGINS_DIR
+ \li \l QT_DEPLOY_PLUGINS_DIR
+ \li
+\row
+ \li \c QML_DIR
+ \li \l QT_DEPLOY_QML_DIR
+ \li
+\endtable
+
+A \c{qt.conf} file is always written if \c{executable} is a macOS app bundle,
+regardless of whether or not \c{GENERATE_QT_CONF} is provided. The \c{..._DIR}
+options are also ignored in that case, since the directory layout of an app
+bundle is dictated by Apple's requirements.
More verbose output about the deployment steps can be enabled by providing the
\c{VERBOSE} option. Alternatively, the \l{QT_ENABLE_VERBOSE_DEPLOYMENT}
@@ -114,10 +154,45 @@ By default, if \c{executable} is a macOS app bundle, only Qt plugins and Qt
libraries that comply with Apple's app store requirements are deployed. The
\c{NO_APP_STORE_COMPLIANCE} option can be given to disable that constraint.
+On platforms other than macOS, Qt translations are automatically deployed. To
+inhibit this behavior, specify \c{NO_TRANSLATIONS}. Use
+\l{qt6_deploy_translations}{qt_deploy_translations()} to deploy translations
+in a customized way.
+
+For Windows desktop applications, the required runtime files for the compiler
+are also installed by default. To prevent this, specify \c{NO_COMPILER_RUNTIME}.
+
+Since Qt 6.7, you can use \c{DEPLOY_TOOL_OPTIONS} to pass additional options to
+the underlying deployment tool. This only has an effect if the underlying
+deployment tool is either macdeployqt or windeployqt.
+
+On Linux, deploying runtime dependencies is based on CMake's
+\c{file(GET_RUNTIME_DEPENDENCIES)} command. The options \c{PRE_INCLUDE_REGEXES},
+\c{PRE_EXCLUDE_REGEXES}, \c{POST_INCLUDE_REGEXES}, \c{POST_EXCLUDE_REGEXES},
+\c{POST_INCLUDE_FILES}, and \c{POST_EXCLUDE_FILES} are only meaningful in this
+context and are forwarded unaltered to \c{file(GET_RUNTIME_DEPENDENCIES)}. See
+the documentation of that command for details.
+
+On Linux, runtime dependencies that are located in system library directories
+are not deployed by default. If \c{POST_EXCLUDE_REGEXES} is specified, this
+automatic exclusion is not performed.
+
+The default value of \c{POST_EXCLUDE_REGEXES} is constructed from the value of
+\l{QT_DEPLOY_IGNORED_LIB_DIRS}.
+
\sa {qt6_generate_deploy_app_script}{qt_generate_deploy_app_script()},
- qt_deploy_qt_conf(), qt_deploy_qml_imports()
+ {qt6_deploy_qt_conf}{qt_deploy_qt_conf()},
+ {qt6_deploy_qml_imports}{qt_deploy_qml_imports()}
\section1 Example
+The following example shows how to deploy an application \c{MyApp}.
+
\include cmake-deploy-runtime-dependencies.qdocinc
+
+The following example shows how to use the \c{DEPLOY_TOOL_OPTIONS} parameter to
+pass different options to macdeployqt and windeployqt.
+
+\include cmake-deploy-runtime-dependencies-deploy-tool-options.qdocinc
+
*/
diff --git a/src/corelib/doc/src/cmake/qt_deploy_translations.qdoc b/src/corelib/doc/src/cmake/qt_deploy_translations.qdoc
new file mode 100644
index 0000000000..43ff23a35a
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_deploy_translations.qdoc
@@ -0,0 +1,76 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+\page qt-deploy-translations.html
+\ingroup cmake-commands-qtcore
+
+\title qt_deploy_translations
+\keyword qt6_deploy_translations
+
+\summary {Deploy Qt translations needed by an executable.}
+
+\include cmake-find-package-core.qdocinc
+
+Unlike most other CMake commands provided by Qt, \c{qt_deploy_translations()}
+can only be called from a deployment script. It cannot be called directly by the
+project during the configure stage.
+
+\cmakecommandsince 6.5
+\preliminarycmakecommand
+\note This command does not usually need to be called directly. It is used
+ internally by other higher level commands, but projects wishing to
+ implement more customized deployment logic may find it useful.
+
+\section1 Synopsis
+
+\badcode
+qt_deploy_translations(
+ [CATALOGS catalogs]
+ [LOCALES locales]
+ [LCONVERT lconvert_executable]
+ [VERBOSE]
+)
+\endcode
+
+\section1 Description
+
+When installing an application, it may be desirable to also install the
+translations that belong to the used Qt modules. The \c qt_deploy_translations
+command collects the necessary \c{.qm} file from the Qt installation and
+compiles them into one \c{qt_${language}.qm} file per language. The \c{.qm}
+files are installed into \c{QT_DEPLOY_TRANSLATIONS_DIR}.
+
+\section1 Arguments
+
+The \c LOCALES argument specifies for which locales translations should be
+deployed. This is a list of language/region combinations as described in
+\l{Changing the Target Locale}{Qt Linguist's manual for translators}. Examples
+for valid locales are: \c{de}, \c{pl}, or \c{pt_BR}.
+
+If \c LOCALES is omitted, then all available locales are deployed.
+
+The \c CATALOGS argument specifies a list of \l{Available
+Catalogs}{translation catalogs} to be deployed. If this argument is
+omitted, then all catalogs are deployed that belong to any Qt module
+that is used in the project via \c{find_package}.
+
+The \c LCONVERT argument specifies the \c lconvert executable that is used to
+combine the catalogs. By default, the Qt installation's \c lconvert is used.
+
+For debugging purposes, the \c VERBOSE argument can be set to turn on diagnostic
+messages.
+
+\sa QT_DEPLOY_TRANSLATIONS_DIR
+
+\section1 Example
+
+The following example deploys Danish and German translations of the Qt
+libraries.
+
+\badcode
+qt_deploy_translations(
+ LOCALES da de
+)
+\endcode
+*/
diff --git a/src/corelib/doc/src/cmake/qt_disable_unicode_defines.qdoc b/src/corelib/doc/src/cmake/qt_disable_unicode_defines.qdoc
index b056afea85..91de52544e 100644
--- a/src/corelib/doc/src/cmake/qt_disable_unicode_defines.qdoc
+++ b/src/corelib/doc/src/cmake/qt_disable_unicode_defines.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_disable_unicode_defines.html
+\page qt-disable-unicode-defines.html
\ingroup cmake-commands-qtcore
\title qt_disable_unicode_defines
-\target qt6_disable_unicode_defines
+\keyword qt6_disable_unicode_defines
\summary {Prevents some unicode-related compiler definitions being set automatically on a target.}
diff --git a/src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc b/src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc
index a430989036..7ec8d90f9b 100644
--- a/src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc
+++ b/src/corelib/doc/src/cmake/qt_extract_metatypes.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_extract_metatypes.html
+\page qt-extract-metatypes.html
\ingroup cmake-commands-qtcore
\title qt_extract_metatypes
-\target qt6_extract_metatypes
+\keyword qt6_extract_metatypes
\summary {Extracts metatypes from a Qt target and generates an associated metatypes.json file.}
@@ -52,4 +52,18 @@ example, to pass it to another command or to install it), use the
\c OUTPUT_FILES option to provide the name of a variable in which to store its
absolute path.
+\section1 Automatic metatype extraction
+
+Since Qt 6.8, if you have not disabled \c{AUTOMOC} and either are using CMake
+3.19 or later or are calling \l{qt6_finalize_target}{qt_finalize_target()}
+manually, then \c{qt_extract_metatypes()} is automatically called as part of the
+finalization step for \l{qt_add_library}. This has no effect if you have
+manually called \c{qt_extract_metatypes()} before the finalization, possibly
+with custom arguments. However, it does make sure that the metatypes are also
+produced if you haven't. This is important if any of the types in the library
+are used as part of any QML types any time in the future and has no downsides.
+
+Furthermore, \l{qt_add_qml_module} automatically invokes
+\c{qt_extract_metatypes()} for its target.
+
*/
diff --git a/src/corelib/doc/src/cmake/qt_finalize_project.qdoc b/src/corelib/doc/src/cmake/qt_finalize_project.qdoc
index dc63e66cd6..5506712691 100644
--- a/src/corelib/doc/src/cmake/qt_finalize_project.qdoc
+++ b/src/corelib/doc/src/cmake/qt_finalize_project.qdoc
@@ -2,13 +2,13 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_finalize_project.html
+\page qt-finalize-project.html
\ingroup cmake-commands-qtcore
\title qt_finalize_project
-\target qt6_finalize_project
+\keyword qt6_finalize_project
-\summary {Handles various common platform-specific tasks associated with Qt project.}
+\summary {Handles various common platform-specific tasks associated with a Qt project.}
\preliminarycmakecommand
\include cmake-find-package-core.qdocinc
@@ -26,15 +26,19 @@ qt_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
+at the end of CMake configuring phase.
+Depending on the platform, the function typically:
+\list
+ \li Walks the build tree.
+ \li Resolves dependencies.
+ \li Applies any extra deployment steps.
+\endlist
+
+With CMake version 3.19 or later, 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.
+\c CMAKE_SOURCE_DIR directory scope processing.
-\include cmake-android-qt-finalize-project-warning.cmake
+\include cmake-android-qt-finalize-project-warning.qdocinc warning
\section2 Examples
@@ -44,4 +48,6 @@ function:
\snippet cmake-macros/examples.cmake qt_finalize_project_manual
+\sa {cmake-variable-QT_NO_COLLECT_BUILD_TREE_APK_DEPS}{QT_NO_COLLECT_BUILD_TREE_APK_DEPS}
+\sa {cmake-variable-QT_NO_COLLECT_IMPORTED_TARGET_APK_DEPS}{QT_NO_COLLECT_IMPORTED_TARGET_APK_DEPS}
*/
diff --git a/src/corelib/doc/src/cmake/qt_finalize_target.qdoc b/src/corelib/doc/src/cmake/qt_finalize_target.qdoc
index 558e89991f..b74dee64d2 100644
--- a/src/corelib/doc/src/cmake/qt_finalize_target.qdoc
+++ b/src/corelib/doc/src/cmake/qt_finalize_target.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_finalize_target.html
+\page qt-finalize-target.html
\ingroup cmake-commands-qtcore
\title qt_finalize_target
-\target qt6_finalize_target
+\keyword qt6_finalize_target
\summary {Handles various common platform-specific tasks associated with Qt targets.}
@@ -32,10 +32,10 @@ was created, so this command should also be called from that same directory
scope.
This command is ordinarily invoked as part of a call to
-\l{qt6_add_executable}{qt_add_executable()} or
-\l{qt6_add_library}{qt_add_library()}. The timing of when that call takes
-place and when it might need to be called explicitly by a project is discussed
-in the documentation of those commands.
+\l{qt6_add_executable}{qt_add_executable()},
+\l{qt6_add_library}{qt_add_library()}, or \l{qt6_add_plugin}{qt_add_plugin()}.
+The timing of when that call takes place and when a project might need to call
+it explicitly, is discussed in the documentation of those commands.
\sa {qt6_set_finalizer_mode}{qt_set_finalizer_mode()}
@@ -61,7 +61,7 @@ CMake version earlier than 3.21.
\section2 WASM
Create \c{${target}.html} (a target-specific \c{wasm_shell.html} file),
-\c{qtloader.js} and \c{qtlogo.svg} files in the \c{CMAKE_CURRENT_BINARY_DIR}.
+\c{qtloader.js}, and \c{qtlogo.svg} files in the \c{CMAKE_CURRENT_BINARY_DIR}.
\section2 iOS
diff --git a/src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc b/src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc
index b3a3328098..31d9e4384b 100644
--- a/src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc
+++ b/src/corelib/doc/src/cmake/qt_generate_deploy_app_script.qdoc
@@ -2,27 +2,35 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_generate_deploy_app_script.html
+\page qt-generate-deploy-app-script.html
\ingroup cmake-commands-qtcore
\title qt_generate_deploy_app_script
-\target qt6_generate_deploy_app_script
+\keyword qt6_generate_deploy_app_script
\summary {Generate a deployment script for an application.}
\include cmake-find-package-core.qdocinc
\cmakecommandsince 6.3
-\preliminarycmakecommand
-\note This command is currently only supported on Windows and macOS.
+\note This command is currently only supported on Windows, macOS, and Linux.
\section1 Synopsis
\badcode
qt_generate_deploy_app_script(
TARGET target
- FILENAME_VARIABLE var_name
+ OUTPUT_SCRIPT <var>
+ [NO_TRANSLATIONS]
+ [NO_COMPILER_RUNTIME]
[NO_UNSUPPORTED_PLATFORM_ERROR]
+ [DEPLOY_TOOL_OPTIONS ...]
+ [PRE_INCLUDE_REGEXES regexes...]
+ [PRE_EXCLUDE_REGEXES regexes...]
+ [POST_INCLUDE_REGEXES regexes...]
+ [POST_EXCLUDE_REGEXES regexes...]
+ [POST_INCLUDE_FILES files...]
+ [POST_EXCLUDE_FILES files...]
)
\endcode
@@ -41,48 +49,62 @@ determined by \l{GNUInstallDirs} (except for macOS app bundles, which follow
Apple's requirements instead).
The command generates a script whose name will be stored in the variable named
-by the \c{FILENAME_VARIABLE} option. That script is only written at CMake
+by the \c{OUTPUT_SCRIPT} option. That script is only written at CMake
generation time. It is intended to be used with the \l{install(SCRIPT)} command,
which should come after the application's target has been installed using
\l{install(TARGETS)}.
-The deployment script will call \l{qt_deploy_runtime_dependencies()} with a
-suitable set of options for the standard install layout.
-Currently, this is only implemented for macOS app bundles built on a macOS
-host and Windows executables built on a Windows host.
+The deployment script will call \l{qt6_deploy_runtime_dependencies}
+{qt_deploy_runtime_dependencies()} with a suitable set of options for the standard
+install layout. Currently, this is only implemented for
+\list
+ \li macOS app bundles built on a macOS host,
+ \li Linux executables built on a Linux host,
+ \li and Windows executables built on a Windows host.
+\endlist
Cross-building a Windows executable on a Linux host, as well as similar
scenarios, are not currently supported.
Calling \c{qt_generate_deploy_app_script()} in such a case will result
in a fatal error, unless the \c{NO_UNSUPPORTED_PLATFORM_ERROR} option is given.
+On platforms other than macOS, Qt translations are automatically deployed. To
+inhibit this behavior, specify \c{NO_TRANSLATIONS}. Use
+\l{qt6_deploy_translations}{qt_deploy_translations()} to deploy translations in a
+customized way.
+
+For Windows desktop applications, the required runtime files for the compiler
+are also installed by default. To prevent this, specify \c{NO_COMPILER_RUNTIME}.
+
+Since Qt 6.7, you can use \c{DEPLOY_TOOL_OPTIONS} to pass additional options to
+the underlying deployment tool. This only has an effect if the underlying
+deployment tool is either macdeployqt or windeployqt.
+
For deploying a QML application, use
\l{qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()}
instead.
+For generating a custom deployment script, use
+\l{qt6_generate_deploy_script}{qt_generate_deploy_script}.
+
+The options \c{PRE_INCLUDE_REGEXES}, \c{PRE_EXCLUDE_REGEXES},
+\c{POST_INCLUDE_REGEXES}, \c{POST_EXCLUDE_REGEXES}, \c{POST_INCLUDE_FILES}, and
+\c{POST_EXCLUDE_FILES} can be specified to control the deployment of runtime
+dependencies. These options do not apply to all platforms and are forwarded
+unmodified to \l{qt6_deploy_runtime_dependencies}{qt_deploy_runtime_dependencies()}.
+
\sa {qt6_standard_project_setup}{qt_standard_project_setup()},
+ {qt6_generate_deploy_script}{qt_generate_deploy_script()},
{qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()}
\section1 Example
-\badcode
-cmake_minimum_required(VERSION 3.16...3.22)
-project(MyThings)
+The following example shows how to deploy an application \c{MyApp}.
-find_package(Qt6 REQUIRED COMPONENTS Core)
-qt_standard_project_setup()
+\include cmake-generate-deploy-app-script.qdocinc
-qt_add_executable(MyApp main.cpp)
+The following example shows how to use the \c{DEPLOY_TOOL_OPTIONS} parameter to
+pass different options to macdeployqt and windeployqt.
-install(TARGETS MyApp
- BUNDLE DESTINATION .
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
-)
+\include cmake-generate-deploy-app-script-deploy-tool-options.qdocinc
-qt_generate_deploy_app_script(
- TARGET MyApp
- FILENAME_VARIABLE deploy_script
- NO_UNSUPPORTED_PLATFORM_ERROR
-)
-install(SCRIPT ${deploy_script})
-\endcode
*/
diff --git a/src/corelib/doc/src/cmake/qt_generate_deploy_script.qdoc b/src/corelib/doc/src/cmake/qt_generate_deploy_script.qdoc
new file mode 100644
index 0000000000..eb8ed402a9
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_generate_deploy_script.qdoc
@@ -0,0 +1,65 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+\page qt-generate-deploy-script.html
+\ingroup cmake-commands-qtcore
+
+\title qt_generate_deploy_script
+\keyword qt6_generate_deploy_script
+
+\summary {Generate a custom deployment script.}
+
+\include cmake-find-package-core.qdocinc
+
+\cmakecommandsince 6.5
+
+\section1 Synopsis
+
+\badcode
+qt_generate_deploy_script(
+ OUTPUT_SCRIPT <var>
+ [TARGET target]
+ [NAME script_name]
+ [CONTENT content]
+)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_generate_deploy_script()
+
+\section1 Description
+
+The command generates a script whose full file path will be stored in the
+variable named by the \c{OUTPUT_SCRIPT} option. That script is only written
+at CMake generation time. It is intended to be used with the \l{install(SCRIPT)}
+command, which should come after the application's target has been installed
+using \l{install(TARGETS)}.
+
+The command takes care of generating a file named suitably for multi-config
+generators. Necessary includes are added such that Qt's CMake deployment
+functions and variables are accessible.
+
+The \c TARGET argument specifies the target that will be deployed by the script.
+This affects the file name of the generated script, unless \c NAME is specified.
+
+The \c NAME argument controls an identifiable portion within the deployment
+script's automatically generated name. The \c NAME argument defaults to \c
+custom if neither \c NAME nor \c TARGET are given.
+
+The \c CONTENT argument specifies the code that is written to the deployment
+script. The content may contain generator expressions.
+
+This command is intended for generating custom deployment scripts that
+directly call functions of Qt's deployment API. For less complex
+deployment purposes, it is more convenient to use
+\l{qt6_generate_deploy_app_script}{qt_generate_deploy_app_script()} or
+\l{qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()}.
+
+\sa {qt6_generate_deploy_app_script}{qt_generate_deploy_app_script()},
+ {qt6_generate_deploy_qml_app_script}{qt_generate_deploy_qml_app_script()}
+
+\section1 Example
+
+\snippet cmake-macros/deployment.cmake qt_generate_deploy_script_example
+
+*/
diff --git a/src/corelib/doc/src/cmake/qt_generate_moc.qdoc b/src/corelib/doc/src/cmake/qt_generate_moc.qdoc
index 4f60ae1ae2..9b123f9323 100644
--- a/src/corelib/doc/src/cmake/qt_generate_moc.qdoc
+++ b/src/corelib/doc/src/cmake/qt_generate_moc.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_generate_moc.html
+\page qt-generate-moc.html
\ingroup cmake-commands-qtcore
\title qt_generate_moc
-\target qt6_generate_moc
+\keyword qt6_generate_moc
\summary {Calls moc on an input file.}
diff --git a/src/corelib/doc/src/cmake/qt_import_plugins.qdoc b/src/corelib/doc/src/cmake/qt_import_plugins.qdoc
index cea6fc61f5..1f81a21cd2 100644
--- a/src/corelib/doc/src/cmake/qt_import_plugins.qdoc
+++ b/src/corelib/doc/src/cmake/qt_import_plugins.qdoc
@@ -2,13 +2,13 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_import_plugins.html
+\page qt-import-plugins.html
\ingroup cmake-commands-qtcore
\title qt_import_plugins
-\target qt6_import_plugins
+\keyword qt6_import_plugins
-\summary {Specifies a custom set of plugins to import for a static Qt build.}
+\summary {Specifies a custom set of plugins to import or exclude.}
\include cmake-find-package-core.qdocinc
@@ -48,17 +48,35 @@ can be used more than once.
Qt provides plugin types such as \c imageformats, \c platforms,
and \c sqldrivers.
+\section2 Dynamic plugins
+
+If plugins are dynamic libraries, the function controls the plugin deployment.
+Using this function, you may exclude specific plugin types from
+being packaged into an Android APK, for example:
+
+\badcode
+qt_add_executable(MyApp ...)
+...
+qt_import_plugins(MyApp EXCLUDE_BY_TYPE imageformats)
+\endcode
+
+In the snippet above, all plugins that have the \c imageformats type will
+be excluded when deploying \c MyApp. The resulting Android APK will not
+contain any of the \c imageformats plugins.
+
+If the command isn't used, the target automatically deploys all plugins that
+belong to the Qt modules that the target is linked against.
+
+\section2 Static plugins
+
If the command isn't used the target automatically links against
-a sane set of default plugins, for each Qt module that the target is linked
-against. For more information, see
+a sane set of default static plugins, for each Qt module that the target is
+linked against. For more information, see
\l{CMake target_link_libraries Documentation}{target_link_libraries}.
Each plugin comes with a C++ stub file that automatically
-initializes the plugin. Consequently, any target that links against a plugin
-has this C++ file added to its \c SOURCES.
-
-\note This command imports plugins from static Qt builds only.
-On shared builds, it does nothing.
+initializes the static plugin. Consequently, any target that links against
+a plugin has this C++ file added to its \c SOURCES.
\section1 Examples
diff --git a/src/corelib/doc/src/cmake/qt_policy.qdoc b/src/corelib/doc/src/cmake/qt_policy.qdoc
new file mode 100644
index 0000000000..6deb7a729c
--- /dev/null
+++ b/src/corelib/doc/src/cmake/qt_policy.qdoc
@@ -0,0 +1,65 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
+
+/*!
+\page qt-policy.html
+\ingroup cmake-commands-qtcore
+
+\title qt_policy
+\keyword qt6_policy
+
+\summary {Modify the default behavior of Qt's CMake API.}
+
+\include cmake-find-package-core.qdocinc
+
+\cmakecommandsince 6.5
+
+\section1 Synopsis
+
+\badcode
+qt_policy(
+ [SET <policy_name> behavior]
+ [GET <policy_name> <variable>]
+)
+\endcode
+
+\versionlessCMakeCommandsNote qt6_policy()
+
+\section1 Description
+
+This command has two modes:
+
+\list
+\li When the \c{SET} keyword is used, this command can be used to opt in to
+ behavior changes in Qt's CMake API, or to explicitly opt out of them.
+\li When the \c{GET} keyword is used, \c{<variable>} is set to the current
+ behavior for the policy, i.e. \c OLD or \c NEW.
+\endlist
+
+\c{<policy_name>} must be the name of one of the \l{Qt CMake policies}.
+Policy names have the form of \c{QTP<NNNN>} where <NNNN> is
+an integer specifying the index of the policy. Using an invalid policy
+name results in an error.
+
+Code supporting older Qt versions can check the existence of a policy by
+checking the value of the \c{QT_KNOWN_POLICY_<policy_name>} variable before
+getting the value of \c <policy_name> or setting its behavior.
+
+\badcode
+if(QT_KNOWN_POLICY_<policy_name>)
+ qt_policy(SET <policy_name> NEW)
+endif()
+\endcode
+
+You can set \c behavior to one of the following options:
+
+\list
+\li \c{NEW} to opt into the new behavior
+\li \c{OLD} to explicitly opt-out of it
+\endlist
+
+\qtpolicydeprecatedbehavior
+
+\sa qt_standard_project_setup
+
+*/
diff --git a/src/corelib/doc/src/cmake/qt_set_finalizer_mode.qdoc b/src/corelib/doc/src/cmake/qt_set_finalizer_mode.qdoc
index 476c63ccc0..28622c11e8 100644
--- a/src/corelib/doc/src/cmake/qt_set_finalizer_mode.qdoc
+++ b/src/corelib/doc/src/cmake/qt_set_finalizer_mode.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_set_finalizer_mode.html
+\page qt-set-finalizer-mode.html
\ingroup cmake-commands-qtcore
\title qt_set_finalizer_mode
-\target qt6_set_finalizer_mode
+\keyword qt6_set_finalizer_mode
\summary {Customizes aspects of a target's finalization.}
diff --git a/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc b/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc
index b94d688e49..59b33f599c 100644
--- a/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc
+++ b/src/corelib/doc/src/cmake/qt_standard_project_setup.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_standard_project_setup.html
+\page qt-standard-project-setup.html
\ingroup cmake-commands-qtcore
\title qt_standard_project_setup
-\target qt6_standard_project_setup
+\keyword qt6_standard_project_setup
\summary {Setup project-wide defaults to a standard arrangement.}
@@ -17,7 +17,12 @@
\section1 Synopsis
\badcode
-qt_standard_project_setup()
+qt_standard_project_setup(
+ [REQUIRES <version>]
+ [SUPPORTS_UP_TO <version>]
+ [I18N_TRANSLATED_LANGUAGES <language...>]
+ [I18N_SOURCE_LANGUAGE <language>]
+)
\endcode
\versionlessCMakeCommandsNote qt6_standard_project_setup()
@@ -42,8 +47,20 @@ have been defined. It does the following things:
\c{${CMAKE_CURRENT_BINARY_DIR}}.
\li When target platforms other than Apple or Windows, \c{CMAKE_INSTALL_RPATH}
will be augmented as described below.
+\li CMake's \l USE_FOLDERS property is set to \c{ON}, and \l QT_TARGETS_FOLDER is
+ set to \c{QtInternalTargets}. IDEs that support folders will display
+ Qt-internal targets in this folder.
\endlist
+Since Qt 6.5, it is possible to change the default behavior of Qt's CMake
+API by opting in to changes from newer Qt versions. If \c{REQUIRES} is
+specified, all suggested changes introduced in Qt up to \c{REQUIRES} are enabled,
+and using an older Qt version will result in an error.
+If additionally \c{SUPPORTS_UP_TO} has been specified, any new changes introduced
+in versions up to \c{SUPPORTS_UP_TO} are also enabled (but using an older Qt
+version is not an error). This is similar to CMake's policy concept
+(compare \l{cmake_policy}).
+
On platforms that support \c{RPATH} (other than Apple platforms), two values
are appended to the \c{CMAKE_INSTALL_RPATH} variable by this command.
\c{$ORIGIN} is appended so that libraries will find other libraries they depend
@@ -57,12 +74,28 @@ will find their link-time dependencies, assuming projects install them to the
default locations the \l{install(TARGETS)} command uses when no destination is
explicitly provided.
+To disable folder support for IDEs, set \l USE_FOLDERS to \c OFF before or after
+the call to \c{qt_standard_project_setup}.
+
The \c{qt_standard_project_setup()} command can effectively be disabled by
setting the \l{QT_NO_STANDARD_PROJECT_SETUP} variable to true.
\sa {qt6_generate_deploy_app_script}{qt_generate_deploy_app_script()}
+\sa qt_policy
+
+\section1 Internationalization
+
+Since Qt 6.7, it is possible to specify the languages that are used for project
+internationalization with the \c I18N_TRANSLATED_LANGUAGES argument. See \l
+QT_I18N_TRANSLATED_LANGUAGES for details.
+
+Use I18N_SOURCE_LANGUAGE to specify the language that translatable strings are
+written in. By default, \c en is used. See \l QT_I18N_SOURCE_LANGUAGE for
+details.
\section1 Example
-\include cmake-deploy-runtime-dependencies.qdocinc
+\include cmake-generate-deploy-app-script.qdocinc
+
+\sa {Automatic Determination of .ts File Paths}{qt_add_translations()}
*/
diff --git a/src/corelib/doc/src/cmake/qt_wrap_cpp.qdoc b/src/corelib/doc/src/cmake/qt_wrap_cpp.qdoc
index 8390b81cd3..3b298a9d7e 100644
--- a/src/corelib/doc/src/cmake/qt_wrap_cpp.qdoc
+++ b/src/corelib/doc/src/cmake/qt_wrap_cpp.qdoc
@@ -2,11 +2,11 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
-\page qt_wrap_cpp.html
+\page qt-wrap-cpp.html
\ingroup cmake-commands-qtcore
\title qt_wrap_cpp
-\target qt6_wrap_cpp
+\keyword qt6_wrap_cpp
\summary {Creates .moc files from sources.}
@@ -40,9 +40,23 @@ You can set an explicit \c{TARGET}. This will make sure that the target
properties \c{INCLUDE_DIRECTORIES} and \c{COMPILE_DEFINITIONS} are also used
when scanning the source files with \c{moc}.
+Since Qt 6.8, when a source file is passed to \c{qt_wrap_cpp} instead of a
+header file to generate a \c{.moc} file for a target, the \c{TARGET} parameter
+is needed to set the correct include path for the generated \c{.moc} file in
+the source file. As generated \c{.moc} files are added to the target's
+sources by \c{qt_wrap_cpp}, they are not added to \c{<VAR>}.
+
You can set additional \c{OPTIONS} that should be added to the \c{moc} calls.
You can find possible options in the \l{moc}{moc documentation}.
+The \c{OPTIONS} can evaluate generator expressions when \c{TARGET} is set.
+\note If the \c{OPTIONS} include both generator expressions and special
+characters, use variables to implement them. For example, use \c{$<ANGLE-R>},
+\c{$<COMMA>} and \c{$<SEMICOLON>} instead of \c{>}, \c{,} and \c{:}. Otherwise,
+the generator expression will not be evaluated correctly. \c {OPTIONS} are
+wrapped in generator expressions, so you must escape special characters in
+them.
+
\c{DEPENDS} allows you to add additional dependencies for recreation of the
generated files. This is useful when the sources have implicit dependencies,
like code for a Qt plugin that includes a \c{.json} file using the
@@ -50,5 +64,27 @@ Q_PLUGIN_METADATA() macro.
\section1 Examples
-\snippet cmake-macros/examples.cmake qt_wrap_cpp
+\snippet cmake-macros/examples.cmake qt_wrap_cpp_1
+
+In the following example, the generator expressions passed to \c{OPTIONS}
+will be evaluated since \c{TARGET} is set. The argument is specified this way to
+avoid syntax errors in the generator expressions.
+
+\snippet cmake-macros/examples.cmake qt_wrap_cpp_2
+
+The following example uses \l{https://cmake.org/cmake/help/latest/command/target_compile_definitions.html}{target_compile_definitions}
+to set \l{https://cmake.org/cmake/help/latest/prop_tgt/COMPILE_DEFINITIONS.html}{COMPILE_DEFINITIONS} which will be added to
+\c{OPTIONS}.
+
+\snippet cmake-macros/examples.cmake qt_wrap_cpp_4
+
+\snippet cmake-macros/examples.cpp qt_wrap_cpp_4
+
+In the above file, \c{myapp.moc} is included in \c{myapp.cpp}.
+To generate the \c{myapp.moc} file, the \c{qt_wrap_cpp} macro is used with the
+\c{TARGET} parameter. The first parameter is empty because the \c{.moc} file
+and its path will be added to the target's sources and include directories by
+the \c{qt_wrap_cpp} macro.
+
+\snippet cmake-macros/examples.cmake qt_wrap_cpp_4
*/