Commit Graph

11 Commits

Author SHA1 Message Date
Alexey Edelev
871f7a05db Revert "Revert "Add support for MultiABI with custom install dir of the android-build""
This reverts commit d7e8d5bb1b.

Reason for revert: Found a working solution for the issue.

Change-Id: Ia720cc63ece9dfb1a24067cdd9c3d79d4edbe3be
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-02-02 19:03:36 +01:00
Alexandru Croitor
d7e8d5bb1b Revert "Add support for MultiABI with custom install dir of the android-build"
This reverts commit 979a21dc4e.

Reason for revert: Caused QTBUG-110836

Task-number: QTBUG-110836
Change-Id: I4f31018954e6bb0f4e7b6db0df76d04c0a56d9b1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-02-01 16:18:55 +00:00
Fab Stz
979a21dc4e Add support for MultiABI with custom install dir of the android-build
Right now, "multi abi builds" of android projects works only if the
android-build installation doesn't use custom install dirs
(INSTALL_PREFIX, INSTALL_BINDIR...)

At the same time, it fixes QTBUG-106533. The patches are the same as the
ones in that bugreport.

Add new items to android-*-deployment-settings.json:

    qtDataDirectory
    qtLibsDirectory
    qtLibExecsDirectory
    qtPluginsDirectory
    qtQmlDirectory

Update androiddeployqt to be able to get files from their install location

BTW (fixes QTBUG-106533):
    Install src/android/templates into INSTALL_DATADIR
    Install src/3rdparty/gradle into INSTALL_DATADIR
    Install src/android/java files into INSTALL_DATADIR
    Install all jars into INSTALL_DATADIR

Add missing path to target_qt.conf
    Update target_qt.conf to have all path. Otherwise qmake wouldn't have
    the path when installing the android-build with custom install dirs
    like INSTALL_LIBDIR & friends

Add support for a new cmake variable that can be set at build time of the
android projects: QT_ANDROID_PATH_CMAKE_DIR_${abi} (Name chosen as
brother of QT_HOST_PATH_CMAKE_DIR)

Pick-to: 6.5
Fixes: QTBUG-106533
Fixes: QTBUG-107207
Change-Id: Ia3751362ab1b5f877ecafbe02f263feac167119c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-30 14:08:14 +01:00
Alexandru Croitor
f7a34630a1 CMake: Use unix paths in android xml files
We aim to allow building Qt for Android on one host, and make it
usable on any host.

Previously when built on a Windows host, we embedded windows style
paths into the android -dependencies.xml files, which caused
androideployqt to fail deployment when building a project on a unix
host.

In Qt 5, the dependencies xml files for Windows Android packages had
unix style paths. Thus switch to always using unix styles paths on
all platforms.

Amends a9d2c5b6d7.

Fixes: QTBUG-107249
Change-Id: I851d3e0b08415b4c7f0d22baf43c10c715879ee7
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-10-07 18:18:23 +02:00
Lucie Gérard
32df595275 Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-23 23:58:42 +02:00
Lucie Gérard
fb1b20eab3 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-03 17:14:55 +02:00
Alexey Edelev
f90221d8cd Replace ANDROID_ABI argument with the QT_ANDROID_ABI target property
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>
2022-01-03 14:35:13 +01:00
Assam Boudjelthia
d6367aca86 CMake: make sure to collect Android dependencies for plugins
androiddeployqt relies on *-android-dependencies.xml files to know
what dependencies like jar files and permissions a Qt module requires.
CMake create those files under Qt prefix's lib dir but CMake was not
accounting for module plugins.

Fixes: QTBUG-90812
Pick-to: 6.1 6.0
Change-Id: Ib3b2e2bb237159b4851ac0f23dc75f8e56af3f7a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 01:02:21 +02:00
Assam Boudjelthia
09fc4f9525 CMake: handle Android features dependencies for modules
QMake used to allow retrieving the Android features list for a modules.
The dependencies are written to *-android-dependencies.xml files and are
read by androiddeployqt. This option was missed at some point along the
way of writing CMake port for Qt 6.

Pick-to: 6.1 6.0
Change-Id: Ic0b82f024567e640968f97aeff2db1888f2b53a5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-18 13:19:31 +02:00
Alex Blasche
8cceb04232 Fix completely wrong init_class and jar_bundle_native values
This prevented androiddeployqt from properly deploying libraries which
specify init class via the ":" delimiter.

Pick-to: 6.0 6.1
Change-Id: Ib9cfa7edc864d7d540577df22284ceb9714a2511
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
2021-02-10 10:38:29 +01:00
Joerg Bornemann
0274daf307 CMake: Rename QtBuildInternalsAndroid.cmake to QtAndroidHelpers.cmake
...and include it in QtBuild.cmake.

Commit e8d8b1a5e4 added two different code paths to include
QtBuildInternalsAndroid.cmake.

This was needed, because:

In a top-level build, we must not include files that are not yet
installed.  We have the source tree available, and
"${QT_SOURCE_TREE}/cmake" is in CMAKE_MODULE_PATH.
We can use the "module syntax" of the include() command.

In a per-repository build, when building against an installed qtbase, we
must not include files of the source tree, because that's not guaranteed
to be available.  However, Qt6BuildInternalsConfig.cmake is installed,
and we can directly include QtBuildInternalsAndroid.cmake, which is
right next to it.

We can circumvent this whole issue by moving the Android-related
functions out of the Qt6BuildInternals package and including it in
QtBuild.cmake.

Pick-to: 6.0
Task-number: QTBUG-88718
Change-Id: I5192ba19bb77952505c20d053d7285f798d16ac5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-24 21:51:34 +01:00