From 32121e9882bc69ad72d8e08ee7c21a684db921c1 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 14 Aug 2020 17:53:37 +0200 Subject: CMake: Split out some Android functions into a public API file 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 --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index fc08130795..10df970dff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,6 +76,9 @@ if(NOT QT_BUILD_STANDALONE_TESTS) #include CoreMacros() for qt6_generate_meta_types() include(src/corelib/Qt6CoreMacros.cmake) + # Needed when building qtbase for android. + include(src/corelib/Qt6AndroidMacros.cmake) + ## Setup documentation add_subdirectory(doc) -- cgit v1.2.3