summaryrefslogtreecommitdiffstats
path: root/src/corelib/Qt6AndroidMacros.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Pass QT_BUILD_STANDALONE_TESTS to Android external project if definedAlexey Edelev2022-01-041-0/+8
| | | | | | | | | | | | | | If we configure qtbase standalone tests for multiple Android ABIs, external project also needs the QT_BUILD_STANDALONE_TESTS flag enabled to avoid configuring the whole qtbase but not only tests. TODO: Need to forward all cache variables that are defined by user to the external project since otherwise the configuration of the external project will differ. Created QTBUG-99537 to track this. Pick-to: 6.3 Change-Id: I3aec1391c850fb37696dc50416e0ff2a2646e759 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix build of multiple apks in a single project treeAlexey Edelev2022-01-041-1/+1
| | | | | | | | | | | | | | | | | | ExternalProject_Add_Step adds the step timestamp file as the dependency to a '-complete' file generated by add_custom_command that is run inside the ExternalProject_Add function. Since the '-complete' file path is computed using CMAKE_CURRENT_BINARY_DIR we run into the issue if ExternalProject_Add and ExternalProject_Add_Step are run from the different source directories and have the different default binary directories as well. This change suppresses the behavior by adding the 'EXCLUDE_FROM_MAIN TRUE' flag. We may do this since the target related to the step is added to the dependency chain of executable target and the chain of external project is not used for now. Pick-to: 6.3 Change-Id: I7203261b61cfa56bcd9e49ac3e8d7ecb217a5a6c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Update internal function signaturesAlexey Edelev2022-01-041-20/+20
| | | | | | | | | | | Update _qt_internal_add_android_deployment_multi_value_property and _qt_internal_add_android_deployment_property signatures to match the _qt_internal_add_android_deployment_list_property signature. Pick-to: 6.3 Change-Id: Ie4fb2ebe96c783222fc4b56c3186e22b96cbbb95 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Collect the apk dependencies regardless of targetAlexey Edelev2022-01-041-31/+70
| | | | | | | | | | | | | | | | | | | | _qt_internal_collect_target_apk_dependencies function is common for all targets, but its signature was telling that it's target-specific. This also causes an issue when we had more than one target in tree that produce apk, since only first target got the property after respective finalizer was executed. This change generalize the function and uses _qt_internal_apk_dependencies target to store the extra library directories from the build tree. _qt_internal_add_android_deployment_list_property signature is also changed to support reading values from multiple lists of multiple targets. Amends d20f4ae706559fb7de8db9dd4845f7ce3936061a Pick-to: 6.3 Change-Id: I5b40fa96a0eb73348c0029e2b13c63a9465cb520 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Replace ANDROID_ABI argument with the QT_ANDROID_ABI target propertyAlexey Edelev2022-01-031-0/+108
| | | | | | | | | | | | | | | | | | | | | | This change tries to make the API more user friendly and prevent wrong use of multi-abi API. ANDROID_ABI argument of qt6_add_executable was position-depend and needed to be placed after the executable 'sources'. Using the target property we solve this problem and provide more consistent and common way to enable multi-abi build for the single target. This meanwhile also requires to execute multi-abi build configuration in the finalizer, since the property might be set at any point. Also the priority of the QT_ANDROID_ABI target property now is higher than the priority of the QT_ANDROID_BUILD_ALL_ABIS variable. So target will only build packages with the ABIs specified in QT_ANDROID_ABI property if both are set. Pick-to: 6.3 Task-number: QTBUG-88841 Change-Id: I3515297ed267974498913c59619433dc234ec217 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix the copy path of the binary when building for Android in QtCreatorAlexey Edelev2021-12-151-1/+1
| | | | | | | | | | | | | The target path of copy command should include 'libs/${CMAKE_ANDROID_ARCH_ABI}' to make the apk build procedure work correctly in QtCreator. Amends 87db26bdfe56e9445c03623eb962f569b2570b92 Pick-to: 6.3 Change-Id: Icaffc3d7418a9a4994f86e453b329a69452c5f0b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use depfile to control ABI-specific builds of executable targetsAlexey Edelev2021-12-021-14/+44
| | | | | | | | | | | | | qt_internal_${target}_copy_apk_dependencies should use CMake DEPFILE approach when it's possible. Since we don't have any specific artifact that androiddeployqt can produce when collecting dependencies this change adds simple timestamp file that is touched each time when androiddeployqt is running. The timestamp is used then as a file-level dependency for the qt_internal_${target}_copy_apk_dependencies target. Task-number: QTBUG-88841 Change-Id: I985535c7b6e471cb4cfbf90128628087dadc72d0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change the external projects approach for multi-abi buildsAlexey Edelev2021-12-021-16/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of generating external projects that build the project tree for each target, this creates a single project for each ABI that have the common for all targets configure steps. Each executable target then adds additional build step to each ABI-specific external project, that builds and copies dependencies to the "main" project build tree. To resolve dependencies from the build tree, when building multi-abi apk instead of scanning the build directories of external projects for dependencies, it makes sense to run androiddeployqt for each ABI-specific external project to copy all necessary libraries. This is done by adding --copy-dependencies-only flag to androiddeployqt that only copies the apk dependencies, but avoids creating apk and all the essential steps. The ABI-specific external project now handles the deploying of the build artifacts to the end-point apk deployment directory and the "main" project assembles the apk using collected artifacts. The ABI-specific external project uses the qt_internal_${target}_copy_apk_dependencies target to run androiddeployqt with the introduced --copy-dependencies-only flag. TODO: Build steps that build and copy the ABI-specific apk dependencies are non-skipable and will run each time top-level build is triggered. This behavior should be fixed by adding dependencies to the generated by androiddeployqt DEPFILES for each ABI in the top-level build. Task-number: QTBUG-88841 Tash-number: QTBUG-94714 Change-Id: Id442a9fbd589f58b70f4204c5215645056b379a2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix the path to the build dir when creating an androiddeployqt depfileAlexey Edelev2021-11-301-1/+14
| | | | | | | | | | According to the CMake documentation any relative paths in DEPFILE should be relative to the CMAKE_CURRENT_BINARY_DIR if the CMP0116 is set to NEW. This also forces CMP0116 to NEW if the policy exists. Pick-to: 6.2 Change-Id: I3d697b008ea06effb2247bc204da9bcc4e9046b4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add _make_aab targetAlexey Edelev2021-11-301-7/+33
| | | | | | | | | | | | | | | | Add target triggering AAB creation. Since the _make_aab target is not added to the ALL set, we may avoid dependency check for it and admit that the target is "always out of date". [ChangeLog][Android][Platform Specific Changes] Add the extra _make_aab targets for each executable target, that can be used to generate android app bundles. Also add aab metatarget to build all _make_aab targets that are created in the project. Pick-to: 6.2 Fixes: QTBUG-96710 Change-Id: I3b0c7fbb5a7dd493ca7a124c4e4b91fd857386bd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Use config-specific suffix of android deployment settings for multi-config onlyAlexey Edelev2021-11-301-1/+10
| | | | | | | | | | | | QtCreator doesn't expect any config-specific suffixes in the android deployment settings file, when running androiddeployqt. This avoids adding the config-specific suffix in the single-config builds and for the first config in the multi-config builds. Amends a41d9bcac90af5d8f528d6198ea91f25e5189082 Change-Id: I606509c9bfd2e75cac144aca37b4568639aae74f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* 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>