1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
5\group cmake-target-properties-qtcore
6\title CMake Target Properties in Qt6 Core
7\brief Lists CMake target properties known to Qt6::Core.
9\l{CMake Commands in Qt6 Core}{CMake Commands} know about the following CMake
12\sa{CMake Property Reference}
16\page cmake-target-property-qt-android-deployment-dependencies.html
17\ingroup cmake-properties-qtcore
18\ingroup cmake-target-properties-qtcore
19\ingroup cmake-android-build-properties
21\title QT_ANDROID_DEPLOYMENT_DEPENDENCIES
22\target cmake-target-property-QT_ANDROID_DEPLOYMENT_DEPENDENCIES
24\brief Overrides the Qt dependencies added to the target's deployment.
26\cmakepropertysince 6.0
27\preliminarycmakeproperty
28\cmakepropertyandroidonly
30By default, \l androiddeployqt will detect the dependencies of your
31application. However, since run-time usage of plugins cannot be detected,
32there could be false positives, as your application might depend on any
33plugin that is a potential dependency. If you want to minimize the size of
34your \c APK, it's possible to override the automatic detection using this
35property. This should contain a list of all Qt files which need to be
36included, with paths relative to the Qt install root.
38\note Only the Qt files specified with this variable are included. Failing
39to include all the correct files can result in crashes. It's also important
40to make sure the files are listed in the correct loading order. This variable
41provides a way to override the automatic detection entirely, so if a library
42is listed before its dependencies, it will fail to load on some devices.
44\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
48\page cmake-target-property-qt-android-extra-libs.html
49\ingroup cmake-properties-qtcore
50\ingroup cmake-target-properties-qtcore
51\ingroup cmake-android-build-properties
53\title QT_ANDROID_EXTRA_LIBS
54\target cmake-target-property-QT_ANDROID_EXTRA_LIBS
56\summary {Extra libraries to deploy with the target.}
58\cmakepropertysince 6.0
59\preliminarycmakeproperty
60\cmakepropertyandroidonly
62A list of external libraries that will be copied into your application's
63\c libs folder and loaded on start-up. This can be used, for instance,
64to enable OpenSSL in your application. For more information, see
65\l{Adding OpenSSL Support for Android}.
67When adding extra libraries from the build tree of your project, it's also
68necessary to add dependency relations between library and the application
69target. Using the following project structure may cause an issue, when deploying
72qt_add_executable(MyApp main.cpp)
74set_target_properties(MyApp PROPERTIES
76 ${CMAKE_CURRENT_BINARY_DIR}/libMyService_${ANDROID_ABI}.so
79# MyService library doesn't have any relations with MyApp
80qt_add_library(MyService service.cpp)
83This leads to uncertainty whether MyService library will be available before
84the deployment of MyApp or not. The easiest solution is adding MyService
85library to the MyApp dependencies:
87add_dependencies(MyApp MyService)
90When adding per-architecture libraries to a multi-abi project,
91list all their paths explicitly, rather than rely on variables like
92\c CMAKE_ANDROID_ARCH_ABI to dynamically compute the paths.
98 ${CMAKE_CURRENT_BINARY_DIR}/libA_x86so
99 ${CMAKE_CURRENT_BINARY_DIR}/libA_x86_64.so
100 ${CMAKE_CURRENT_BINARY_DIR}/libA_arm64-v8a.so
101 ${CMAKE_CURRENT_BINARY_DIR}/libA_armeabi-v7a.so
103set_target_properties(MyApp PROPERTIES QT_ANDROID_EXTRA_LIBS ${libs})
105# When targeting precompiled libs
106target_link_libraries(${CMAKE_PROJECT_NAME} PUBLIC libA_${ANDROID_ABI})
112set_target_properties(MyApp PROPERTIES
113 QT_ANDROID_EXTRA_LIBS
114 ${CMAKE_CURRENT_BINARY_DIR}/libA_${CMAKE_ANDROID_ARCH_ABI}.so)
117\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
121\page cmake-target-property-qt-android-extra-plugins.html
122\ingroup cmake-properties-qtcore
123\ingroup cmake-target-properties-qtcore
124\ingroup cmake-android-build-properties
126\title QT_ANDROID_EXTRA_PLUGINS
127\target cmake-target-property-QT_ANDROID_EXTRA_PLUGINS
129\summary {Extra Qt plugins to deploy with the target.}
131\cmakepropertysince 6.0
132\preliminarycmakeproperty
133\cmakepropertyandroidonly
135Specifies a path to C++ plugins or resources that your application has to bundle
136but that cannot be delivered through the assets system, such as QML plugins.
137With this variable, \l androiddeployqt will make sure everything is packaged
138and deployed properly.
140\c QT_ANDROID_EXTRA_PLUGINS must point to the directory where the extra plugin(s)
141are built. In addition, the build directory structure must follow a naming
142convention similar to Qt plugins, that is, \e {plugins/<plugin name>}.
143\c QT_ANDROID_EXTRA_PLUGINS should point to the \e {plugins} part of that path.
145The plugins libraries should have the name format
146\e {libplugins_<type>_<name>_<abi>.so}. This will ensure that the correct name
147mangling is applied to the plugin library.
149\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
153\page cmake-target-property-qt-android-min-sdk-version.html
154\ingroup cmake-properties-qtcore
155\ingroup cmake-target-properties-qtcore
156\ingroup cmake-android-build-properties
158\title QT_ANDROID_MIN_SDK_VERSION
159\target cmake-target-property-QT_ANDROID_MIN_SDK_VERSION
161\summary {Minimum Android SDK version.}
163\cmakepropertysince 6.1
164\preliminarycmakeproperty
165\cmakepropertyandroidonly
167Specifies the minimum Android API level for the target.
169\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
173\page cmake-target-property-qt-android-package-source-dir.html
174\ingroup cmake-properties-qtcore
175\ingroup cmake-target-properties-qtcore
176\ingroup cmake-android-build-properties
178\title QT_ANDROID_PACKAGE_SOURCE_DIR
179\target cmake-target-property-QT_ANDROID_PACKAGE_SOURCE_DIR
181\summary {Path to a custom Android package template.}
183\cmakepropertysince 6.0
184\preliminarycmakeproperty
185\cmakepropertyandroidonly
187Specifies the path for a custom Android package template. The Android package
190 \li AndroidManifest.xml file
191 \li build.gradle file and other Gradle scripts
192 \li res/values/libs.xml file
195The path specified by this variable can contain custom Java classes under
196\c src directory. By default, the \l androiddeployqt tool copies the
197application template from the Qt for Android installation path into your
198project's build directory, then it copies the contents of the path specified
199by this variable on top of that, overwriting any existing files. For
200instance, you can make a custom \c {AndroidManifest.xml} for your application,
201then place this directly into the directory specified by this variable.
203\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
207\page cmake-target-property-qt-android-target-sdk-version.html
208\ingroup cmake-properties-qtcore
209\ingroup cmake-target-properties-qtcore
210\ingroup cmake-android-build-properties
212\title QT_ANDROID_TARGET_SDK_VERSION
213\target cmake-target-property-QT_ANDROID_TARGET_SDK_VERSION
215\summary {Android target SDK version.}
217\cmakepropertysince 6.1
218\preliminarycmakeproperty
219\cmakepropertyandroidonly
221Specifies the target Android API level for the target.
223\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
227\page cmake-target-property-qt-android-sdk-build-tools-revision.html
228\ingroup cmake-properties-qtcore
229\ingroup cmake-target-properties-qtcore
230\ingroup cmake-android-build-properties
232\title QT_ANDROID_SDK_BUILD_TOOLS_REVISION
233\target cmake-target-property-QT_ANDROID_SDK_BUILD_TOOLS_REVISION
235\summary {Revision of Android build tools to use.}
237\cmakepropertysince 6.0
238\preliminarycmakeproperty
239\cmakepropertyandroidonly
241Specifies the Android SDK build tools revision to use. If this is not set then
242CMake will attempt to use the latest installed version.
244\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
248\page cmake-target-property-qt-android-package-name.html
249\ingroup cmake-properties-qtcore
250\ingroup cmake-target-properties-qtcore
251\ingroup cmake-android-build-properties
253\title QT_ANDROID_PACKAGE_NAME
254\target cmake-target-property-QT_ANDROID_PACKAGE_NAME
256\summary {The app's package name.}
258\cmakepropertysince 6.8
259\preliminarycmakeproperty
260\cmakepropertyandroidonly
262Specifies the app's package name. This is usually a unique dot separated
263name for the app, that will be used to identify the app on devices or in
264the Play Store. For example, "org.qtproject.example.gallery".
266The package name set by this property is passed to the \c build.gradle file
267as a \c namespace property, instead of \c AndroidManifest.xml, since the
268latter is deprecated since Android Gradle Plugin 7.4.
270The package name considers some words or characters as illegal and the build
271will clean such names if any is encountered. An underscore (\c _) either replaces
272illegal characters or is appended to illegal words.
275 \li Allowed characters: alphanumeric, an underscore or a dot [a-zA-Z0-9_.].
276 \li Illegal words: abstract, continue, for, new, switch, assert, default,
277 if, package, synchronized, boolean, do, goto, private, this, break,
278 double, implements, protected, throw, byte, else, import, public,
279 throws, case, enum, instanceof, return, transient, catch, extends,
280 int, short, try, char, final, interface, static, void, class, finally,
281 long, strictfp, volatile, const, float, native, super, while.
284The default package name for Qt for Android apps is \c org.qtproject.example.<target_name>.
286\note Setting the package name manually in \c build.gradle (via
287\c namespace property) takes precedence over \c AndroidManifest.xml
288(via \c package attribute), and the latter also takes precedence over
291For more information, see Android's
292\l{Android: Configure the app module}{configure the app module}.
294\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
298\page cmake-target-property-qt-android-version-code.html
299\ingroup cmake-properties-qtcore
300\ingroup cmake-target-properties-qtcore
302\title QT_ANDROID_VERSION_CODE
303\target cmake-target-property-QT_ANDROID_VERSION_CODE
304\ingroup cmake-android-manifest-properties
306\summary {Internal Android app version.}
308\cmakepropertysince 6.1
309\preliminarycmakeproperty
310\cmakepropertyandroidonly
312Specifies the app's version number. This is usually a number that
313increments monotonically with each release of your project.
315For more information, see \l{Android: App Versioning}{Android App Versioning}.
317\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
321\page cmake-target-property-qt-android-version-name.html
322\ingroup cmake-properties-qtcore
323\ingroup cmake-target-properties-qtcore
325\title QT_ANDROID_VERSION_NAME
326\target cmake-target-property-QT_ANDROID_VERSION_NAME
327\ingroup cmake-android-manifest-properties
329\summary {Human-readable Android app version.}
331\cmakepropertysince 6.1
332\preliminarycmakeproperty
333\cmakepropertyandroidonly
335Specifies the app's version as a human readable string, usually three
336numbers, separated by dots.
338For more information, see \l{Android: App Versioning}{Android App Versioning}.
340\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
344\page cmake-target-property-qt-android-abis.html
345\ingroup cmake-properties-qtcore
346\ingroup cmake-target-properties-qtcore
347\ingroup cmake-android-build-properties
349\title QT_ANDROID_ABIS
350\target cmake-target-property-QT_ANDROID_ABIS
352\summary {List of ABIs that packages of a single target are built for.}
354\cmakepropertysince 6.3
355\preliminarycmakeproperty
356\cmakepropertyandroidonly
358By setting the \c{QT_ANDROID_ABIS} property for a target, it's possible to control
359the list of ABIs that the single target packages are supposed to be built for.
360\include cmake-android-supported-abis.qdocinc
361The property only affects targets created with
362\l{qt6_add_executable}{qt_add_executable()}.
364\sa{cmake-variable-QT_ANDROID_ABIS}{QT_ANDROID_ABIS}, {QT_ANDROID_BUILD_ALL_ABIS}
368\page cmake-target-property-qt-qml-root-path.html
369\ingroup cmake-properties-qtcore
370\ingroup cmake-target-properties-qtcore
372\title QT_QML_ROOT_PATH
373\target cmake-target-property-QT_QML_ROOT_PATH
375\summary {Overrides the location of the application's qml directory.}
377\cmakepropertysince 6.1
378\preliminarycmakeproperty
380This property is currently only used when generating a deployment settings file
381for Android. If the property is set, it specifies the path to the application's
382\c{qml} directory. If it is not set, the \c{SOURCE_DIR} property of the target
385\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
389\page cmake-target-property-qt-qml-import-path.html
390\ingroup cmake-properties-qtcore
391\ingroup cmake-target-properties-qtcore
393\title QT_QML_IMPORT_PATH
394\target cmake-target-property-QT_QML_IMPORT_PATH
396\summary {Specifies a list of directories to search for QML imports.}
398\cmakepropertysince 6.0
399\preliminarycmakeproperty
401This property is currently only used when generating a deployment settings file
402for Android. It typically contains just the path to Qt's \c{qml} directory, but
403it can be a list that contains other locations to be searched as well.
404For application-specific QML imports, use
405\l{cmake-target-property-QT_QML_ROOT_PATH}{QT_QML_ROOT_PATH} instead.
407\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
411\page cmake-target-property-qt-android-deployment-settings-file.html
412\ingroup cmake-properties-qtcore
413\ingroup cmake-target-properties-qtcore
414\ingroup cmake-android-build-properties
416\title QT_ANDROID_DEPLOYMENT_SETTINGS_FILE
417\target cmake-target-property-QT_ANDROID_DEPLOYMENT_SETTINGS_FILE
419\summary {Specifies the location of a target's generated deployment settings file.}
421\cmakepropertysince 6.0
422\preliminarycmakeproperty
423\cmakepropertyandroidonly
425This property will be set by
426\l{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}.
427Projects should not try to set this property themselves, as it will be ignored
428and overwritten by that command.
432\page cmake-target-property-qt-android-system-libs-prefix.html
433\ingroup cmake-properties-qtcore
434\ingroup cmake-target-properties-qtcore
435\ingroup cmake-android-build-properties
437\title QT_ANDROID_SYSTEM_LIBS_PREFIX
438\target cmake-target-property-QT_ANDROID_SYSTEM_LIBS_PREFIX
440\summary {Specifies the location of Qt libraries on the target device.}
442\preliminarycmakeproperty
443\cmakepropertyandroidonly
445This property can be set to provide a path to Qt libraries on the target device,
446when those libraries are installed outside app's native (JNI) library directory.
450\page cmake-target-property-qt-android-no-deploy-qt-libs.html
451\ingroup cmake-properties-qtcore
452\ingroup cmake-target-properties-qtcore
453\ingroup cmake-android-build-properties
455\title QT_ANDROID_NO_DEPLOY_QT_LIBS
456\target cmake-target-property-QT_ANDROID_NO_DEPLOY_QT_LIBS
458\summary {Whether Qt shared libraries are packaged in the APK on Android.}
460\preliminarycmakeproperty
461\cmakepropertyandroidonly
463This property can be set to not package Qt shared libraries inside the APK when
464deploying the target. Use
465\l{cmake-target-property-QT_ANDROID_SYSTEM_LIBS_PREFIX}{QT_ANDROID_SYSTEM_LIBS_PREFIX}
466to provide a path to where those libraries will be located on the target device
469\note Only supported when deploying as an APK.
473\page cmake-target-property-qt-no-entrypoint.html
474\ingroup cmake-properties-qtcore
475\ingroup cmake-target-properties-qtcore
477\title qt_no_entrypoint
478\target cmake-target-property-qt_no_entrypoint
480\summary {Specifies to inhibit linking against Qt's entrypoint lib.}
482\cmakepropertysince 6.1
483\preliminarycmakeproperty
485On certain platforms, Qt applications link against Qt's entrypoint lib by default.
486That library provides implementations of main (or WinMain).
488On targets that must provide their own entry point, set the property \c qt_no_entrypoint to inhibit linking against Qt's entrypoint library.
492\page cmake-target-property-qt-resource-prefix.html
493\ingroup cmake-properties-qtcore
494\ingroup cmake-target-properties-qtcore
496\title QT_RESOURCE_PREFIX
497\target cmake-target-property-QT_RESOURCE_PREFIX
499\summary {Specifies the default Qt resource prefix.}
501\cmakepropertysince 6.0
502\preliminarycmakeproperty
504When using \l{qt6_add_resources}{qt_add_resources} without a \c PREFIX
505argument, then the value of this target property will be used as
510\group cmake-source-file-properties-qtcore
511\title CMake Source File Properties in Qt6 Core
512\brief Lists CMake file properties used in Qt6::Core.
514\l{CMake Commands in Qt6 Core}{CMake Commands} know about the following CMake
515source file properties:
517\sa{CMake Property Reference}
521\page cmake-source-file-property-qt-resource-alias.html
522\ingroup cmake-source-file-properties-qtcore
524\title QT_RESOURCE_ALIAS
525\target cmake-source-file-property-QT_RESOURCE_ALIAS
527\summary {Specifies the Qt resource alias for a file in a resource.}
529\cmakepropertysince 6.0
531When using the target-based variant of \l{qt6_add_resources}{qt_add_resources}
532the property value overrides the runtime path where the resource file is found.
534\sa{The Qt Resource System}
538\page cmake-source-file-property-qt-discard-file-contents.html
539\ingroup cmake-source-file-properties-qtcore
541\title QT_DISCARD_FILE_CONTENTS
542\target cmake-source-file-property-QT_DISCARD_FILE_CONTENTS
544\summary {Specifies that the given files should be empty in the resource file system}
546\cmakepropertysince 6.6
547\preliminarycmakeproperty
549When using the target-based variant of \l{qt6_add_resources}{qt_add_resources}
550or \l{qt_add_qml_module}, setting this property to \c TRUE causes the file
551contents to be omitted when creating the resource file system. The file name is
554This is useful if you want to strip QML source code from the binary.
556\note If you omit the QML source code from the binary, the QML engine has to
557rely on the compilation units created by \l{qmlcachegen} or \l{qmlsc}.
558Those are tied to the specific version of Qt they were built with. If you change
559the version of Qt your application uses, they can't be loaded anymore.
561\sa{The Qt Resource System}
565\page cmake-target-property-qt-wasm-pthread-pool-size.html
566\ingroup cmake-properties-qtcore
567\ingroup cmake-target-properties-qtcore
569\title QT_WASM_PTHREAD_POOL_SIZE
570\target cmake-target-property-QT_WASM_PTHREAD_POOL_SIZE
572\summary {Internal WebAssembly thread pool size.}
574\cmakepropertysince 6.2.4
575\preliminarycmakeproperty
576\cmakepropertywebassemblyonly
578Specifies the number of web workers (threads) to create at application startup.
579Qt allocates a pool size of 4 by default. This means the app can use
5804 additional threads besides the main thread, without the additional overhead
581of creating a new web worker, which may deadlock if the main thread created it
582and join()s the thread without returning control to the event loop first.
583Translates into the Emscripten compiler setting of PTHREAD_POOL_SIZE.
585For more information, see \l{https://emscripten.org/docs/porting/pthreads.html}{Pthreads support}.
589\group cmake-global-properties-qtcore
590\title CMake Global Properties in Qt6 Core
591\brief Lists CMake global properties used or defined in Qt6::Core.
593\l{CMake Commands in Qt6 Core}{CMake Commands} know about the following global
596\sa{CMake Property Reference}
600\page cmake-global-property-qt-targets-folder.html
601\ingroup cmake-properties-qtcore
602\ingroup cmake-global-properties-qtcore
604\title QT_TARGETS_FOLDER
605\target cmake-global-property-QT_TARGETS_FOLDER
607\brief Sets the FOLDER property for Qt-internal targets.
609\cmakepropertysince 6.5
610\preliminarycmakeproperty
612Name of the \l FOLDER for internal targets that are added by Qt's CMake
615By default, this property is not set.
617This property only has an effect if CMake's \l USE_FOLDERS property is \c{ON}.
619You can use the \l{qt6_standard_project_setup}{qt_standard_project_setup}
620function to enable folder support and initialize the \c{QT_TARGETS_FOLDER}.
622\sa{qt6_standard_project_setup}{qt_standard_project_setup}
626\page cmake-target-property-qt-wasm-initial-memory.html
627\ingroup cmake-properties-qtcore
628\ingroup cmake-target-properties-qtcore
630\title QT_WASM_INITIAL_MEMORY
631\target cmake-target-property-QT_WASM_INITIAL_MEMORY
633\summary {Internal WebAssembly initial memory.}
635\cmakepropertysince 6.2.4
636\preliminarycmakeproperty
637\cmakepropertywebassemblyonly
639Specifies the initial amount of memory to use, in bytes. Using more will cause the
640browser to copy the old heap into a new one. Translates into the
641Emscripten compiler setting of INITIAL_MEMORY.
642QT_WASM_INITIAL_MEMORY must be a multiple of 65536 bytes.
644For more information, see \l{https://github.com/emscripten-core/emscripten/blob/main/src/settings.js}{Emscripten compiler settings}.
648\page cmake-target-property-qt-wasm-maximum-memory.html
649\ingroup cmake-properties-qtcore
650\ingroup cmake-target-properties-qtcore
652\title QT_WASM_MAXIMUM_MEMORY
653\target cmake-target-property-QT_WASM_MAXIMUM_MEMORY
655\summary {Internal WebAssembly maximum memory.}
657\cmakepropertysince 6.7
658\preliminarycmakeproperty
659\cmakepropertywebassemblyonly
661Specifies the maximum amount of memory the application can use. Translates into
662the Emscripten compiler setting of \c MAXIMUM_MEMORY. The default value
663is 4GB, which is the maximum for 32-bit WebAssembly.
665For more information, see the \l{https://github.com/emscripten-core/emscripten/blob/3319a313d3b589624d342b650884caaf8cd9ef30/src/settings.js#L187}{Emscripten compiler settings}.
671\page cmake-target-property-qt-ios-launch-screen.html
672\ingroup cmake-properties-qtcore
673\ingroup cmake-target-properties-qtcore
675\title QT_IOS_LAUNCH_SCREEN
676\target cmake-target-property-QT_IOS_LAUNCH_SCREEN
678\summary {Path to iOS launch screen storyboard}
680\cmakepropertysince 6.4
681\preliminarycmakeproperty
684Specifies the path to an iOS launch screen storyboard file.
686\sa {Launch Screens and Launch Images}