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
252\title QT_ANDROID_PACKAGE_NAME
253\target cmake-target-property-QT_ANDROID_PACKAGE_NAME
255\summary {The app's package name.}
257\cmakepropertysince 6.8
258\preliminarycmakeproperty
259\cmakepropertyandroidonly
261Specifies the app's package name. This is usually a unique dot separated
262name for the app, that will be used to identify the app on devices or in
263the Play Store. For example, "org.qtproject.example.gallery".
265The package name set by this property is passed to the \c build.gradle file
266as a \c namespace property, instead of \c AndroidManifest.xml, since the
267latter is deprecated since Android Gradle Plugin 7.4.
269The package name considers some words or characters as illegal and the build
270will clean such names if any is encountered. An underscore (\c _) either replaces
271illegal characters or is appended to illegal words.
274 \li Allowed characters: alphanumeric, an underscore or a dot [a-zA-Z0-9_.].
275 \li Illegal words: abstract, continue, for, new, switch, assert, default,
276 if, package, synchronized, boolean, do, goto, private, this, break,
277 double, implements, protected, throw, byte, else, import, public,
278 throws, case, enum, instanceof, return, transient, catch, extends,
279 int, short, try, char, final, interface, static, void, class, finally,
280 long, strictfp, volatile, const, float, native, super, while.
283The default package name for Qt for Android apps is \c org.qtproject.example.<target_name>.
285\note Setting the package name manually in \c build.gradle (via
286\c namespace property) takes precedence over \c AndroidManifest.xml
287(via \c package attribute), and the latter also takes precedence over
290For more information, see Android's
291\l{Android: Configure the app module}{configure the app module}.
293\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
297\page cmake-target-property-qt-android-version-code.html
298\ingroup cmake-properties-qtcore
299\ingroup cmake-target-properties-qtcore
301\title QT_ANDROID_VERSION_CODE
302\target cmake-target-property-QT_ANDROID_VERSION_CODE
303\ingroup cmake-android-manifest-properties
305\summary {Internal Android app version.}
307\cmakepropertysince 6.1
308\preliminarycmakeproperty
309\cmakepropertyandroidonly
311Specifies the app's version number. This is usually a number that
312increments monotonically with each release of your project.
314For more information, see \l{Android: App Versioning}{Android App Versioning}.
316\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
320\page cmake-target-property-qt-android-version-name.html
321\ingroup cmake-properties-qtcore
322\ingroup cmake-target-properties-qtcore
324\title QT_ANDROID_VERSION_NAME
325\target cmake-target-property-QT_ANDROID_VERSION_NAME
326\ingroup cmake-android-manifest-properties
328\summary {Human-readable Android app version.}
330\cmakepropertysince 6.1
331\preliminarycmakeproperty
332\cmakepropertyandroidonly
334Specifies the app's version as a human readable string, usually three
335numbers, separated by dots.
337For more information, see \l{Android: App Versioning}{Android App Versioning}.
339\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
343\page cmake-target-property-qt-android-abis.html
344\ingroup cmake-properties-qtcore
345\ingroup cmake-target-properties-qtcore
346\ingroup cmake-android-build-properties
348\title QT_ANDROID_ABIS
349\target cmake-target-property-QT_ANDROID_ABIS
351\summary {List of ABIs that packages of a single target are built for.}
353\cmakepropertysince 6.3
354\preliminarycmakeproperty
355\cmakepropertyandroidonly
357By setting the \c{QT_ANDROID_ABIS} property for a target, it's possible to control
358the list of ABIs that the single target packages are supposed to be built for.
359\include cmake-android-supported-abis.qdocinc
360The property only affects targets created with
361\l{qt6_add_executable}{qt_add_executable()}.
363\sa{cmake-variable-QT_ANDROID_ABIS}{QT_ANDROID_ABIS}, {QT_ANDROID_BUILD_ALL_ABIS}
367\page cmake-target-property-qt-qml-root-path.html
368\ingroup cmake-properties-qtcore
369\ingroup cmake-target-properties-qtcore
371\title QT_QML_ROOT_PATH
372\target cmake-target-property-QT_QML_ROOT_PATH
374\summary {Overrides the location of the application's qml directory.}
376\cmakepropertysince 6.1
377\preliminarycmakeproperty
379This property is currently only used when generating a deployment settings file
380for Android. If the property is set, it specifies the path to the application's
381\c{qml} directory. If it is not set, the \c{SOURCE_DIR} property of the target
384\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
388\page cmake-target-property-qt-qml-import-path.html
389\ingroup cmake-properties-qtcore
390\ingroup cmake-target-properties-qtcore
392\title QT_QML_IMPORT_PATH
393\target cmake-target-property-QT_QML_IMPORT_PATH
395\summary {Specifies a list of directories to search for QML imports.}
397\cmakepropertysince 6.0
398\preliminarycmakeproperty
400This property is currently only used when generating a deployment settings file
401for Android. It typically contains just the path to Qt's \c{qml} directory, but
402it can be a list that contains other locations to be searched as well.
403For application-specific QML imports, use
404\l{cmake-target-property-QT_QML_ROOT_PATH}{QT_QML_ROOT_PATH} instead.
406\sa{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}
410\page cmake-target-property-qt-android-deployment-settings-file.html
411\ingroup cmake-properties-qtcore
412\ingroup cmake-target-properties-qtcore
413\ingroup cmake-android-build-properties
415\title QT_ANDROID_DEPLOYMENT_SETTINGS_FILE
416\target cmake-target-property-QT_ANDROID_DEPLOYMENT_SETTINGS_FILE
418\summary {Specifies the location of a target's generated deployment settings file.}
420\cmakepropertysince 6.0
421\preliminarycmakeproperty
422\cmakepropertyandroidonly
424This property will be set by
425\l{qt6_android_generate_deployment_settings}{qt_android_generate_deployment_settings()}.
426Projects should not try to set this property themselves, as it will be ignored
427and overwritten by that command.
431\page cmake-target-property-qt-android-system-libs-prefix.html
432\ingroup cmake-properties-qtcore
433\ingroup cmake-target-properties-qtcore
434\ingroup cmake-android-build-properties
436\title QT_ANDROID_SYSTEM_LIBS_PREFIX
437\target cmake-target-property-QT_ANDROID_SYSTEM_LIBS_PREFIX
439\summary {Specifies the location of Qt libraries on the target device.}
441\preliminarycmakeproperty
442\cmakepropertyandroidonly
444This property can be set to provide a path to Qt libraries on the target device,
445when those libraries are installed outside app's native (JNI) library directory.
449\page cmake-target-property-qt-android-no-deploy-qt-libs.html
450\ingroup cmake-properties-qtcore
451\ingroup cmake-target-properties-qtcore
452\ingroup cmake-android-build-properties
454\title QT_ANDROID_NO_DEPLOY_QT_LIBS
455\target cmake-target-property-QT_ANDROID_NO_DEPLOY_QT_LIBS
457\summary {Whether Qt shared libraries are packaged in the APK on Android.}
459\preliminarycmakeproperty
460\cmakepropertyandroidonly
462This property can be set to not package Qt shared libraries inside the APK when
463deploying the target. Use
464\l{cmake-target-property-QT_ANDROID_SYSTEM_LIBS_PREFIX}{QT_ANDROID_SYSTEM_LIBS_PREFIX}
465to provide a path to where those libraries will be located on the target device
468\note Only supported when deploying as an APK.
472\page cmake-target-property-qt-no-entrypoint.html
473\ingroup cmake-properties-qtcore
474\ingroup cmake-target-properties-qtcore
476\title qt_no_entrypoint
477\target cmake-target-property-qt_no_entrypoint
479\summary {Specifies to inhibit linking against Qt's entrypoint lib.}
481\cmakepropertysince 6.1
482\preliminarycmakeproperty
484On certain platforms, Qt applications link against Qt's entrypoint lib by default.
485That library provides implementations of main (or WinMain).
487On targets that must provide their own entry point, set the property \c qt_no_entrypoint to inhibit linking against Qt's entrypoint library.
491\page cmake-target-property-qt-resource-prefix.html
492\ingroup cmake-properties-qtcore
493\ingroup cmake-target-properties-qtcore
495\title QT_RESOURCE_PREFIX
496\target cmake-target-property-QT_RESOURCE_PREFIX
498\summary {Specifies the default Qt resource prefix.}
500\cmakepropertysince 6.0
501\preliminarycmakeproperty
503When using \l{qt6_add_resources}{qt_add_resources} without a \c PREFIX
504argument, then the value of this target property will be used as
509\group cmake-source-file-properties-qtcore
510\title CMake Source File Properties in Qt6 Core
511\brief Lists CMake file properties used in Qt6::Core.
513\l{CMake Commands in Qt6 Core}{CMake Commands} know about the following CMake
514source file properties:
516\sa{CMake Property Reference}
520\page cmake-source-file-property-qt-resource-alias.html
521\ingroup cmake-source-file-properties-qtcore
523\title QT_RESOURCE_ALIAS
524\target cmake-source-file-property-QT_RESOURCE_ALIAS
526\summary {Specifies the Qt resource alias for a file in a resource.}
528\cmakepropertysince 6.0
530When using the target-based variant of \l{qt6_add_resources}{qt_add_resources}
531the property value overrides the runtime path where the resource file is found.
533\sa{The Qt Resource System}
537\page cmake-source-file-property-qt-discard-file-contents.html
538\ingroup cmake-source-file-properties-qtcore
540\title QT_DISCARD_FILE_CONTENTS
541\target cmake-source-file-property-QT_DISCARD_FILE_CONTENTS
543\summary {Specifies that the given files should be empty in the resource file system}
545\cmakepropertysince 6.6
546\preliminarycmakeproperty
548When using the target-based variant of \l{qt6_add_resources}{qt_add_resources}
549or \l{qt_add_qml_module}, setting this property to \c TRUE causes the file
550contents to be omitted when creating the resource file system. The file name is
553This is useful if you want to strip QML source code from the binary.
555\note If you omit the QML source code from the binary, the QML engine has to
556rely on the compilation units created by \l{qmlcachegen} or \l{qmlsc}.
557Those are tied to the specific version of Qt they were built with. If you change
558the version of Qt your application uses, they can't be loaded anymore.
560\sa{The Qt Resource System}
564\page cmake-target-property-qt-wasm-pthread-pool-size.html
565\ingroup cmake-properties-qtcore
566\ingroup cmake-target-properties-qtcore
568\title QT_WASM_PTHREAD_POOL_SIZE
569\target cmake-target-property-QT_WASM_PTHREAD_POOL_SIZE
571\summary {Internal WebAssembly thread pool size.}
573\cmakepropertysince 6.2.4
574\preliminarycmakeproperty
575\cmakepropertywebassemblyonly
577Specifies the number of web workers (threads) to create at application startup.
578Qt allocates a pool size of 4 by default. This means the app can use
5794 additional threads besides the main thread, without the additional overhead
580of creating a new web worker, which may deadlock if the main thread created it
581and join()s the thread without returning control to the event loop first.
582Translates into the Emscripten compiler setting of PTHREAD_POOL_SIZE.
584For more information, see \l{https://emscripten.org/docs/porting/pthreads.html}{Pthreads support}.
588\group cmake-global-properties-qtcore
589\title CMake Global Properties in Qt6 Core
590\brief Lists CMake global properties used or defined in Qt6::Core.
592\l{CMake Commands in Qt6 Core}{CMake Commands} know about the following global
595\sa{CMake Property Reference}
599\page cmake-global-property-qt-targets-folder.html
600\ingroup cmake-properties-qtcore
601\ingroup cmake-global-properties-qtcore
603\title QT_TARGETS_FOLDER
604\target cmake-global-property-QT_TARGETS_FOLDER
606\brief Sets the FOLDER property for Qt-internal targets.
608\cmakepropertysince 6.5
609\preliminarycmakeproperty
611Name of the \l FOLDER for internal targets that are added by Qt's CMake
614By default, this property is not set.
616This property only has an effect if CMake's \l USE_FOLDERS property is \c{ON}.
618You can use the \l{qt6_standard_project_setup}{qt_standard_project_setup}
619function to enable folder support and initialize the \c{QT_TARGETS_FOLDER}.
621\sa{qt6_standard_project_setup}{qt_standard_project_setup}
625\page cmake-target-property-qt-wasm-initial-memory.html
626\ingroup cmake-properties-qtcore
627\ingroup cmake-target-properties-qtcore
629\title QT_WASM_INITIAL_MEMORY
630\target cmake-target-property-QT_WASM_INITIAL_MEMORY
632\summary {Internal WebAssembly initial memory.}
634\cmakepropertysince 6.2.4
635\preliminarycmakeproperty
636\cmakepropertywebassemblyonly
638Specifies the initial amount of memory to use, in bytes. Using more will cause the
639browser to copy the old heap into a new one. Translates into the
640Emscripten compiler setting of INITIAL_MEMORY.
641QT_WASM_INITIAL_MEMORY must be a multiple of 65536 bytes.
643For more information, see \l{https://github.com/emscripten-core/emscripten/blob/main/src/settings.js}{Emscripten compiler settings}.
647\page cmake-target-property-qt-wasm-maximum-memory.html
648\ingroup cmake-properties-qtcore
649\ingroup cmake-target-properties-qtcore
651\title QT_WASM_MAXIMUM_MEMORY
652\target cmake-target-property-QT_WASM_MAXIMUM_MEMORY
654\summary {Internal WebAssembly maximum memory.}
656\cmakepropertysince 6.7
657\preliminarycmakeproperty
658\cmakepropertywebassemblyonly
660Specifies the maximum amount of memory the application can use. Translates into
661the Emscripten compiler setting of \c MAXIMUM_MEMORY. The default value
662is 4GB, which is the maximum for 32-bit WebAssembly.
664For more information, see the \l{https://github.com/emscripten-core/emscripten/blob/3319a313d3b589624d342b650884caaf8cd9ef30/src/settings.js#L187}{Emscripten compiler settings}.
670\page cmake-target-property-qt-ios-launch-screen.html
671\ingroup cmake-properties-qtcore
672\ingroup cmake-target-properties-qtcore
674\title QT_IOS_LAUNCH_SCREEN
675\target cmake-target-property-QT_IOS_LAUNCH_SCREEN
677\summary {Path to iOS launch screen storyboard}
679\cmakepropertysince 6.4
680\preliminarycmakeproperty
683Specifies the path to an iOS launch screen storyboard file.
685\sa {Launch Screens and Launch Images}