From 52c799ed4425076df4353c02950ea1444fe5f102 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 18 Oct 2019 16:07:45 +0200 Subject: Android: Add multi-abi support for CMake The patch adds ANDROID_BUILD_ABI_ CMake options, which when enabled will determine CMake to build the current project with the enabled ABI settings. When building with CMake and the official Android CMake toolchain one needs to specify the Qt base directory as an argument to CMAKE_FIND_ROOT_PATH, which contains the Android NDK sysroot set by the toolchain. CMake will consider directories that contain this base path as valid directories to search packages. In the developer build case we have to append "lib/cmake" because the Qt base directory passed as CMAKE_FIND_ROOT_PATH will be the same directory as the developer build base, and will not be considered. Change-Id: I180502032c8ea1105bde2456252b367497f511d6 Reviewed-by: Alexandru Croitor Reviewed-by: BogDan Vatra --- src/corelib/corelib.pro | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/corelib/corelib.pro') diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index 452d2db0fd..6c101e21ca 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -99,6 +99,12 @@ cmake_umbrella_config_module_location_for_install.output = $$DESTDIR/cmake/insta cmake_umbrella_config_version_file.input = $$PWD/../../mkspecs/features/data/cmake/Qt5ConfigVersion.cmake.in cmake_umbrella_config_version_file.output = $$DESTDIR/cmake/Qt5/Qt5ConfigVersion.cmake +android { + cmake_android_support.input = $$PWD/Qt5AndroidSupport.cmake + cmake_android_support.output = $$DESTDIR/cmake/Qt5Core/Qt5AndroidSupport.cmake + cmake_android_support.CONFIG = verbatim +} + load(cmake_functions) defineTest(pathIsAbsolute) { @@ -144,6 +150,11 @@ QMAKE_SUBSTITUTES += \ cmake_extras_mkspec_dir \ cmake_extras_mkspec_dir_for_install +android { + QMAKE_SUBSTITUTES += cmake_android_support + ctest_qt5_module_files.files += $$cmake_android_support.output +} + ctest_qt5_module_files.files += $$ctest_macros_file.output $$cmake_extras_mkspec_dir_for_install.output ctest_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5Core -- cgit v1.2.3