summaryrefslogtreecommitdiffstats
path: root/src/corelib/Qt6AndroidMacros.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Simplify apk build procedure when using DEPFILEAlexey Edelev2021-11-261-21/+17
| | | | | | | | | | | In qt6_android_add_apk_target we require that ${target} is already defined. So to add custom command that runs androiddeployqt we may simply read BINARY_DIR property of the target and use it as path to generated apk file as OUTPUT argument. This avoids the use any intermediate paths when producing apk and related artifacts. Change-Id: I8bb4174f6f9696e7a2a6b5d6399bb410419495fc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix generating of Android deployment config in Multi-Config buildAlexey Edelev2021-11-191-1/+2
| | | | | | | | | | Add the config-specific suffix to the generated Android deployment config file. Amends d20f4ae706559fb7de8db9dd4845f7ce3936061a Change-Id: If1755baf5548adb4d95733477d8b5af85e1fd2dd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move the ${target}_prepare_apk_dir target descriptionAlexey Edelev2021-11-051-5/+4
| | | | | | | | | Move the description of ${target}_prepare_apk_dir to the right place. The code related to qt_internal_plugins was mistakenly placed between comment and target creation, so move it to avoid confusion. Change-Id: Iaf178811a30ce0f51d6131c8a68f024d3efddfeb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make sure that all MODULE_LIBRARY targets are built before deploying to AndroidAlexey Edelev2021-11-051-0/+12
| | | | | | | | | | | | | | | Users may add the implicit runtime depedencies to the MODULE_LIBRARY targets, that are created using standard CMake API. When iterating a project tree we collect all module libraries and add them as dependencies to the qt_internal_plugins meta target. All the ${target}_make_apk targets depend on this meta target, so we can be sure that plugins are built and present on the file system before running androiddeployqt. Task-number: QTBUG-94714 Task-number: QTBUG-88841 Change-Id: I4fa7f0772d23897f19db59c6e4ad38646bd3aed6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Make sure that all plugin targets are built before deploying to AndroidAlexey Edelev2021-11-051-2/+12
| | | | | | | | | | | | | | | | | | | We need to make sure that all plugin targets are built and present on the file system before running androiddeployqt. This especially important when building executables that depend on qml modules that are built in the project tree. This adds meta target that collects all the plugin targets as dependencies and adds this meta target as the dependency for the custom target that executes androiddeployqt. TODO: We should also take into account MODULE libraries that were added using the CMake add_library call, but since qt6_finalize_project is not a part of 6.2 API, this will be added in follow up commit. Pick-to: 6.2 Task-number: QTBUG-94714 Task-number: QTBUG-88841 Change-Id: I4b4596eb8ed364dbe80e2cfb0ce31cec32e7c03f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add CMake variable to run androiddeployqt with --verbose argumentAlexey Edelev2021-11-021-0/+3
| | | | | | | Change-Id: Ib913e0471ef9c7efcc64c52de21a2e4c7d44e416 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Add Android qml staging prefix to qml import pathsAlexey Edelev2021-11-021-1/+10
| | | | | | | | | | | | | | Qml modules are staged to the special folder when building for android. To make them visible we need add this folder to qml imports paths that are used by qmlimportscanner. Fix typo in _qt_native_qml_import_paths property name when converting QT_QML_IMPORT_PATH property. Pick-to: 6.2 Task-number: QTBUG-96898 Change-Id: Iaf1e06c64553e8ea27f020226095da36e1f9d881 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add --no-rcc-bundle-cleanup option to androiddeployqt toolAlexey Edelev2021-10-291-0/+6
| | | | | | | | | | | Add --no-rcc-bundle-cleanup option to androiddeployqt tool that helps to debug android build procedures and check the raw rcc bundle for missing items. Also add the QT_INTERNAL_NO_ANDROID_RCC_BUNDLE_CLEANUP CMake variable that adds the option when configuring projects for Android. Change-Id: I1f30ba979f9fb3274e44a53fdc5ebde4e65f0843 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fix target existence check in qt6_android_generate_deployment_settingsAlexey Edelev2021-10-291-6/+5
| | | | | | | | | Move the check to the beginning of the function. Pick-to: 6.2 Change-Id: Ia44bb2e56626b00e75efabf2ebdc8eb97eee0ff8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Craig Scott <craig.scott@qt.io>
* corelib: Fix typos in source code commentsJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 6.2 Change-Id: Ic78afb67143112468c6f84677ac88f27a74b53aa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add basic android multi-abi support for CMake projectsAlexey Edelev2021-10-051-13/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use CMake external project to crosscompile android libraries for mutliple android ABIs at the same time. The idea behind is to use pre-compiled Qt for each android ABI in external projects, compile libraries and then utilize results of compilation in common androiddeployqt call. By default multi-abi build uses the main ABI that qt toolchain file belongs to. The list of the autodetected Qt for Android ABIs is stored in QT_DEFAULT_ANDROID_ABIS cache variable. Users may change the set of the Android ABIs project-wide using QT_ANDROID_ABIS CMake variable or for the specific target by adding the ANDROID_ABIS argument when calling qt6_add_executable. To enable build for the autodetected ABIs user may set the QT_ANDROID_BUILD_ALL_ABIS option to TRUE. By default build procedure is looking for the respective android_<abi> folders to run per-abi build. If user's Qt for Android folder structure is different then one is created by Qt installer, path to the each Qt for Android might be overwritten using QT_PATH_ANDROID_ABI_<abi> CMake variable. Note: This only adds support for the multi-abi build of user's applications. TODO: This commit limits projects to not have in-tree library dependencies. That means that executable targets may have dependencies only from Qt directories or android sysroots. See QTBUG-94714 for details. [ChangeLog][Android][Platform Specific Changes] Added basic support for multi-abi builds of user projects. Task-number: QTBUG-88841 Change-Id: I3239ffe61e6b437e170c8decc5c36a9e774ed0fb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* CMake: Allow providing custom QT_ANDROID_SDK_BUILD_TOOLS_REVISIONAssam Boudjelthia2021-10-041-2/+5
| | | | | | | | | | | The current CMake configuration sets QT_ANDROID_SDK_BUILD_TOOLS_REVISION only internally, taking the latest build-tools found. A project might still want to manually set specific build-tools version. Pick-to: 6.2 Task-number: QTBUG-97002 Change-Id: I553563638160fdef7a27b9b334d1d9aae5d8b7e1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix building of unit tests for Android in developer buildAndreas Buhr2021-09-291-1/+7
| | | | | | | | | | Currently it is not possible to build unit tests for Android in a developer build. This patch fixes this. Fixes: QTBUG-94882 Change-Id: I30ccacc4536032ee3a7fbf05ce90bbbcdb8331a6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Replace manual android properties reading with genex'sAlexey Edelev2021-09-091-88/+128
| | | | | | | | | | | | | Since qt6_android_generate_deployment_settings uses 'file(GENERATE' API now, we can use generator expressions when writing target properties to deployment setting files. This adds the generic functions to accumulate list and non-list target properties and write them to a deployment setting file with respecitve key. Change-Id: Ibfdc875c84c39166f26b2f12ab59831d4f9a6e00 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Support deploying of libraries from a build tree when building android apkAlexey Edelev2021-09-091-8/+123
| | | | | | | | | | | | | | | | | | | | | | | | | If the project consists of an executable and multiple libraries that are linked to the executable, currently you need to specify them manually using QT_ANDROID_EXTRA_LIBS target property. This automates deploying of the libraries that are a part of the project build tree. _qt_internal_collect_target_apk_dependencies collects all the known non-imported shared libraries from the project build tree. When running androiddeployqt we specify extra library directories that point to the collected library locations in build tree, to help androiddeployqt resolve shared libraries that are build as a part of the project. The described procedure is running automatically if CMake version is greater than or equal to 3.18 is. For the CMake versions less than 3.18 users need to call a new public qt_finalize_project function at the end of project's top-level CMakeLists.txt Task-number: QTBUG-94714 Change-Id: I400ca4e49e940cfc25ae90d65372e79825bee55a Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* androiddeployqt: Add support of multiple qml root pathsAlexey Edelev2021-09-081-5/+13
| | | | | | | | | | | | | | | | | If application uses qml files from multiple locations, e.g. subdirectories inside source directory it's important to provide this information to qmlimportscanner to produce consistent set of QML modules that need to be included into the end-point application apk. This makes possible to specify more than one QT_QML_ROOT_PATH per target and propagates these paths to the qmlimportscanner using androiddeployqt tool. Pick-to: 6.2 Task-number: QTBUG-93340 Change-Id: Ic31017b3f2671108adb6d6118ef1c75f1ccc3ec5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Revert "Ensure versionless wrappers do not introduce a new variable scope"Craig Scott2021-09-061-6/+6
| | | | | | | | | | | | | This reverts commit 08180e76e6116f0ef66476ca00b2b676b3aa50da. Macros add another level of escaping that functions do not. The conversion of the versionless wrappers to macros may alter the behavior, so revert that change. Task-number: QTBUG-96219 Pick-to: 6.2 Change-Id: Ic5dcff3081123d957888584ba1d76ae0580d9083 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Ensure versionless wrappers do not introduce a new variable scopeCraig Scott2021-08-311-6/+6
| | | | | | | | | | | | | | Using function instead of macro prevented the wrappers from being able to pass back any variables set in the wrapped function. In some cases, these variables were being explicitly passed back to the caller, but that isn't needed if you just make each wrapper a macro. This also makes things more future-proof because any newly introduced output variables will work without having to update the wrappers. Task-number: QTBUG-96121 Pick-to: 6.2 Change-Id: Ic4486de668694c06b47e466587b2cdcb969ea047 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Add the json option to disable the zstd based compressionAlexey Edelev2021-08-231-0/+8
| | | | | | | | | | | | | Need to disable zstd compression if its support is not built in Qt for Android. The flag is dected when configuring user's project and is a part of the deployment settings. This partially fixes loading of android_rcc_bundle.rcc. Pick-to: 6.2 Task-number: QTBUG-93340 Task-number: QTBUG-95969 Change-Id: I635afb3f9e182a559d53e9344e07f62788f9837d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add whitespace to Android error messageKai Köhne2021-08-051-3/+3
| | | | | | Pick-to: 6.2 Change-Id: I9c7729a7bef4a659b10fe69a73b30f101cbba546 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Let androiddeployqt write a dependency fileAndreas Buhr2021-07-081-21/+40
| | | | | | | | | Let androiddeployqt write a dependency file so that the build system knows when to re-run it. Fixes: QTBUG-94567 Change-Id: I5985d707f257b22789013a74f0a6f7c4de6e5e88 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix Qt tool apks not to be built as part of default all targetAlexandru Croitor2021-06-111-16/+35
| | | | | | | | | | | | | | | | | | | | | | | | The code already checked for QT_BUILDING_QT to decide whether the 'apk' target should be part of the default 'all' target, but it only worked properly for qtbase. The 'apk' target was created before the value of QT_BUILDING_QT is set when building other repos like qttools. Postpone the decision on whether 'apk' should be part of 'all' to the first call of qt_add_executable -> qt_android_add_apk_target. At this point QT_BUILDING_QT will be defined. Achieve that by relying on an additional 'apk_all' target as an implementation detail. Amends 8b8679f73d6cfb513141cc0a9f4925a64ca19455 Pick-to: 6.2 6.1 Fixes: QTBUG-94442 Task-number: QTBUG-94264 Change-Id: I92ff0a7eef2caad244340ab7835e77c9fb3377c0 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix global 'apk' target to actually build all apksAlexandru Croitor2021-06-081-11/+29
| | | | | | | | | | | | | | | | | | | | This means calling 'ninja apk' in a user project with multiple android applications will build all their respective apks. For user projects, make the 'apk' target part of the global 'ALL' target, so that a regular 'ninja' call implies the 'apk' target. We don't do it currently for Qt builds, because certain test executable apks fail to build. Add a QT_NO_GLOBAL_APK_TARGET_PART_OF_ALL variable to allow removing the global apk target from the 'all' target. Pick-to: 6.1 Task-number: QTBUG-94264 Change-Id: I171b9da50eb7d670176704bd26dc1c492118b434 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* CMake: Add Android's prepare_apk_dir target to ALLAssam Boudjelthia2021-06-021-2/+2
| | | | | | | | | | Since Qt Creator uses androiddeployqt custom commands it still needs a step to prepare the apk dir before building it, so add this to ALL to avoid having to call it manually in creator. Pick-to: 6.1 Change-Id: I0a2816244589e9b296a326fcc1abf8c08aabfea7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix path of qmlimportscanner for AndroidKai Köhne2021-05-311-1/+1
| | | | | | | | Amends c113c88aa29c47d55dc01 Fixes: QTBUG-94077 Change-Id: If8dff3ec3750e88fcff5e6e076e0666eef2ca142 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add proper dependencies to apk targetsJoerg Bornemann2021-05-171-14/+27
| | | | | | | | | | | | | | | | | | | Before, building ${target}_make_apk always re-built the apk, instead of rebuilding the apk only when inputs changed. This patch fixes that by moving the creation code from a custom target to a custom command with proper dependencies. The androidtestrunner tool now does not check for the existence of an apk anymore and always runs the make command that is supposed to build the apk. The ${target}_prepare_apk_dir target is not needed anymore by the Qt build but is still used by Qt Creator's Android support. Add a clarifying comment. Fixes: QTBUG-93431 Change-Id: I00d65d616fef9511b03b65f879c4bc6cb92dfc30 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add QT_ANDROID_TARGET_SDK_VERSION target propertyJoerg Bornemann2021-04-261-0/+7
| | | | | | | | | | | This is the counterpart of the qmake variable ANDROID_TARGET_SDK_VERSION. Pick-to: 6.1 Task-number: QTBUG-86033 Change-Id: Idd64ee06eb94826430e6be5d9d878631db67c949 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Add QT_ANDROID_MIN_SDK_VERSION target propertyJoerg Bornemann2021-04-261-0/+7
| | | | | | | | | | This is the counterpart to the qmake variable ANDROID_MIN_SDK_VERSION. Pick-to: 6.1 Task-number: QTBUG-86033 Change-Id: I4e1434a794f3a8345f9b4e045ab4366d486221af Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Add QT_ANDROID_VERSION_{NAME|CODE} target propertiesJoerg Bornemann2021-04-261-2/+12
| | | | | | | | | | Those are the CMake counterparts of the qmake variables ANDROID_VERSION_{NAME|CODE}. Pick-to: 6.1 Task-number: QTBUG-86033 Change-Id: I57534ff04db0c78871fe7ba81bedaf377422054b Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Move build tools to libexec instead of the bin dirJoerg Bornemann2021-02-231-1/+1
| | | | | | | | | | | | | | [ChangeLog][Build System] Tools that are called by the build system and are unlikely to be called by the user are now installed to the libexec directory. This is a step towards easier co-installability of different Qt versions. Pick-to: 6.1 Task-number: QTBUG-88791 Change-Id: Id19575b5ba27795f7715e4ea6a09391b26dd4942 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* CMake: always pass QT6_INSTALL_PREFIX to androiddeployqtAssam Boudjelthia2021-02-101-5/+2
| | | | | | | | | | | | Qt CMake uses a fake_prefix as install dir when running tests instead of the main qt install path, this will throw androiddeployqt off since it expects the real qt install path which has gradle and java sources. Fixes: QTBUG-88579 Pick-to: 6.0 6.1 Change-Id: I6580470840ae14d4a4a68a95f217b30408d7ab44 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix typo in android APK generation logAlex Blasche2021-02-101-1/+1
| | | | | | Pick-to: 6.0 6.1 Change-Id: I9e593f35e1c4a51ef2cd4b08fe7e4b7c1a35a5d6 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* android: Generate deployment settings file with correct qml-import-pathsCraig Scott2021-01-061-2/+7
| | | | | | | | | | | | | | | | | The qt6_android_generate_deployment_settings() command had been creating deployment settings files with the wrong key name for qml import paths. This resulted in the QT_QML_IMPORT_PATH target property having no effect. The QT_QML_IMPORT_PATH property can also potentially hold a list, not just a single value. This change now handles the list case as well, previously qt6_android_generate_deployment_settings() was assuming it always held a single path if it was set. Fixes: QTBUG-89628 Pick-to: 6.0 Change-Id: Ibdd74ec8d130f160433a60a14a0a9f496f496a1b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Prefer canonical CMAKE_ANDROID_NDK var when writing deploy fileCraig Scott2021-01-041-1/+1
| | | | | | | | | | | | | | | | | CMAKE_ANDROID_NDK is an official variable provided by CMake. The ANDROID_NDK variable will be set by the NDK toolchain file, but we don't need to rely on that (the user could theoretically not be using the NDK's toolchain file). Using the CMake-provided variable means we don't have to explain the source of the variable in documentation for the qt6_android_generate_deployment_settings() command. We should prefer to use things provided by CMake already where it makes sense and this seems to be one such case. Task-number: QTBUG-89651 Task-number: QTBUG-88839 Pick-to: 6.0 Change-Id: Ieda54de8f5c65c36da6bb55c87a8b8fdd1d5cd7b Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Use host variables instead of hardcoded directoriesAlexey Edelev2020-12-211-3/+3
| | | | | | | | | | | | | | | | | | | 'QT_HOST_PATH' indicates that we use crosscompilation toolchain to build project. In this case 'Qt6Config.cmake' loads 'Qt6HostInfoConfig.cmake' from host QT_HOST_PATH, that defines correct paths to host tools. Replace hardcoded paths for host tools by paths recorded in Qt6HostInfoConfig.cmake. Correct conditions for QT_HOST_PATH, evaluate it explicitly as string, but not as boolean expression. Fixes: QTBUG-86557 Pick-to: 6.0 Change-Id: Ib52bbd32478051d019a932dcb1f735e2d4aacfbf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: fix indentations in Qt6AndroidMacros.cmakeAssam Boudjelthia2020-12-011-11/+8
| | | | | | Pick-to: 6.0 Change-Id: I1403101fb2ab6a25ab1a2258f9a832f706b8b547 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: don't add empty QT_ANDROID_APPLICATION_ARGUMENTS to JsonAssam Boudjelthia2020-12-011-2/+4
| | | | | | Pick-to: 6.0 Change-Id: I471da3f733046aeaa8381bbdeeba3ee2775b97eb Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: add CMAKE_FIND_ROOT_PATH as extraPrefixDirs for androiddeployqtAssam Boudjelthia2020-11-201-0/+11
| | | | | | | | | | | | | | | | androiddeployqt has extraPrefixDirs to provide extra prefix paths in addition to the main Qt install path, however, for some reason, it was not being used. With this, apps for Android using Conan can pass the Conan build prefix for androiddeployqt to use it as well. Task-number: QTBUG-88519 Change-Id: Iad73055ac6c03e3ffe86fca271dbda67ac29a275 Reviewed-by: Iikka Eklund <iikka.eklund@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 00e726ce12431e8c3db8bc9deb8952f930a5a672) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: add --apk to androiddeployqt to copy resulting apk to build dirAssam Boudjelthia2020-11-061-0/+1
| | | | | | Task-number: QTQAINFRA-3867 Change-Id: If036aa88d8e9db3ddc9d27811ccfafa1152a9f2a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Rename some public API functionsAlexandru Croitor2020-10-161-8/+2
| | | | | | | | | | | | | | | | | | | Some of them have a different (hopefully better) name now. Some are marked as Technical Preview. Some are renamed to be internal. Marking add_qt_gui_executable as TP with the intention to un-TP it after we rename it and change its behavior as discussed in the API review meeting. Additional changes to add_qt_gui_executable and qt6_add_resources have been filed as separate tasks that will be worked on separately. See comments on PS1 for details. Task-number: QTBUG-86827 Change-Id: I56a84a1943b0902bb807310dc620eb381824e8dd Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Android: unify deployment-settings.json path to unix formatAssam Boudjelthia2020-10-021-8/+8
| | | | | | | | Always use unix path formats for qmake and cmake builds. Task-number: QTBUG-87066 Change-Id: I9d54c2ca687d28e38542850e3e18b6184513a9af Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Clean up the public API a bitAlexandru Croitor2020-10-011-2/+7
| | | | | | | | | | Add some missing versionless functions. Rename some functions that are not meant to be public API, and their usages. Task-number: QTBUG-86827 Change-Id: Ifb66c04cd7598d83fe80c01a92ab2d269ebaf396 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: fix sdkBuildToolsRevision not being set for user appsAssam Boudjelthia2020-09-291-1/+22
| | | | | | | | | | | Add qt6_android_get_sdk_build_tools_revision() function to get the Android SDK build tools revision, the logic is moved from QtPlatformAndroid to Qt6AndroidMacros. The update QtPlatformAndroid header comments. Task-number: QTBUG-85982 Change-Id: If3e5b46fa583f929a24794792c9d5a52beb83990 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: make QT_ANDROID_DEPLOYMENT_SETTINGS_FILE consistent with qmakeAssam Boudjelthia2020-09-281-1/+1
| | | | | | | | | Make name format of QT_ANDROID_DEPLOYMENT_SETTINGS_FILE consistent with qmake, that is android-${target}-deployment-settings.json. Task-number: QTCREATORBUG-24678 Change-Id: I2bdb056cf7a82fd83aaf658f3a405a0c9ef05756 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: partially revert 00a1e5dAssam Boudjelthia2020-09-231-0/+4
| | | | | | | | | | 00a1e5da7e1aea373a7e6be1d51e1573ff167dd8 wrongfully added parts of QtPlatformAndroid.cmake which were removed in 32121e9882bc69ad72d8e08ee7c21a684db921c1. This removed the part in question again Change-Id: Ie18968e6a165f52c68f4941ced6add266985bc48 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: use bin for instead of QT6_HOST_INFO_BINDIRAssam Boudjelthia2020-09-101-3/+3
| | | | | | | | | | | ${QT6_HOST_INFO_BINDIR} is returning an empty string making the tools paths unusable, and android apps building fails. Partially revert 09ac1bdfc5d2ee7a537c63e54348a8cf8d905fcf. Task-number: QTBUG-86557 Change-Id: I1522b3a4b45fbcb41894ea3bd7c714f7a79eb954 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Android: enable androiddeployqt to get the host's rcc binary pathAssam Boudjelthia2020-08-281-2/+11
| | | | | | | | | | Since Qt 6 CMake installs the host and target into separate directories, androiddeployqt fails to get the correct path to rcc. This change includes the host's rcc binary path in deployment-settings.json. Task-number: QTBUG-85399 Change-Id: I610bb6fea1180a119e4c0ceb75bf78c175ae430e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Split out some Android functions into a public API fileAlexandru Croitor2020-08-141-0/+256
To fix CMake Qt For Android projects to configure, we need to move some functions from a private CMake API file only, to a public one. Add Qt6AndroidMacros.cmake which will be loaded by Qt6Core package. We'll have to decide how we proceed with Qt5AndroidSupport.cmake, because that file automatically runs code when included in Qt5, and we usually don't want to do it. We'll also have to decide how to handle the define_property() calls that are still left in the private QtPlatformAndroid.cmake file. With this fix, Qt example CMake projects that use add_qt_gui_executable should now be buildable. An APK can be created with 'ninja apk'. Unfortunately Qt Creator 4.13 does not currently seem to support opening and building CMake Qt For Android projects properly. While the build succeeds after fiddling with the Kit settings, the APK deploy step fails to run (at least on my machine). So the simplest way to run the built APK is to open the android-build dir with Android Studio and launch the example application from there. Task-number: QTBUG-85399 Change-Id: I77f246331de7a6e9e6d4ba7d973730190138f136 Reviewed-by: Cristian Adam <cristian.adam@qt.io>