diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2019-06-05 12:07:42 +0200 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2019-06-05 14:20:31 +0000 |
commit | 04da0df56851565fe93f69be72efbba2b492d5db (patch) | |
tree | fe0bc43e08e70b0d5dd798f02f48fc29341dab17 /src | |
parent | bc9409d85748c7167a9e8e7eec82fa6c9420ea3d (diff) |
Android: SDK Support
Enable building androiddeployqt when performing host builds only.
Added QtPlatformAndroid.cmake to locate Java and the setup the
android SDK platform when building on android.
Install the androiddeployqt support files when performing a host
build.
Added ANDROID_SDK_ROOT configuration variable for specifying the
android sdk directory.
Generating the deployment-settings.json will be done in another
change.
Change-Id: I1bf15315af4ed904d2fb1d22b0e8e834df32d6ed
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/android/CMakeLists.txt | 12 | ||||
-rw-r--r-- | src/android/jar/CMakeLists.txt | 32 | ||||
-rw-r--r-- | src/android/java/CMakeLists.txt | 11 | ||||
-rw-r--r-- | src/android/templates/CMakeLists.txt | 18 | ||||
-rw-r--r-- | src/tools/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/tools/androiddeployqt/CMakeLists.txt | 27 |
7 files changed, 107 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3a3e358c73..682f70ebd2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -56,3 +56,5 @@ endif() add_subdirectory(plugins) add_subdirectory(winmain) + +add_subdirectory(android) diff --git a/src/android/CMakeLists.txt b/src/android/CMakeLists.txt new file mode 100644 index 0000000000..7b0b0cd930 --- /dev/null +++ b/src/android/CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from android.pro. + +# special case begin +# Only build jars during android build? +if (ANDROID) + add_subdirectory(jar) +endif() +# special case end + +# Templates need to be installed during host build +add_subdirectory(java) +add_subdirectory(templates) diff --git a/src/android/jar/CMakeLists.txt b/src/android/jar/CMakeLists.txt new file mode 100644 index 0000000000..31afb3fdf4 --- /dev/null +++ b/src/android/jar/CMakeLists.txt @@ -0,0 +1,32 @@ +# QtAndroid Jar + +# special case begin +set(path_prefix ${CMAKE_CURRENT_SOURCE_DIR}/src/org/qtproject/qt5/android/) + +set(java_sources + ${path_prefix}/accessibility/QtAccessibilityDelegate.java + ${path_prefix}/accessibility/QtNativeAccessibility.java + ${path_prefix}/CursorHandle.java + ${path_prefix}/EditContextView.java + ${path_prefix}/EditPopupMenu.java + ${path_prefix}/ExtractStyle.java + ${path_prefix}/QtActivityDelegate.java + ${path_prefix}/QtEditText.java + ${path_prefix}/QtInputConnection.java + ${path_prefix}/QtLayout.java + ${path_prefix}/QtMessageDialogHelper.java + ${path_prefix}/QtNative.java + ${path_prefix}/QtNativeLibrariesDir.java + ${path_prefix}/QtServiceDelegate.java + ${path_prefix}/QtSurface.java + ${path_prefix}/QtThread.java) + +add_jar(QtAndroid + INCLUDE_JARS ${android_jar} + SOURCES ${java_sources} + ) + +install_jar(QtAndroid + DESTINATION jar + COMPONENT Devel) +# special case end diff --git a/src/android/java/CMakeLists.txt b/src/android/java/CMakeLists.txt new file mode 100644 index 0000000000..d2c0c3df24 --- /dev/null +++ b/src/android/java/CMakeLists.txt @@ -0,0 +1,11 @@ +# Android Java Resource files + +# special case begin +set(resource_directories + res + src) + +qt_install(DIRECTORY ${resource_directories} + DESTINATION src/android/java + COMPONENT Devel) +# special case end diff --git a/src/android/templates/CMakeLists.txt b/src/android/templates/CMakeLists.txt new file mode 100644 index 0000000000..b330840cc7 --- /dev/null +++ b/src/android/templates/CMakeLists.txt @@ -0,0 +1,18 @@ +# Android template files + +# special case begin +set(template_files + AndroidManifest.xml + build.gradle) + +set(template_directories + res) + +qt_install(FILES ${template_files} + DESTINATION src/android/templates + COMPONENT Devel) + +qt_install(DIRECTORY ${template_directories} + DESTINATION src/android/templates + COMPONENT Devel) +# special case end diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 77942a9c7e..f1f0a8ce93 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -5,3 +5,8 @@ if (QT_FEATURE_dbus) endif() add_subdirectory(qlalr) add_subdirectory(qvkgen) + +# Only include the following tools when performing a host build +if(NOT CMAKE_CROSSCOMPILING) + add_subdirectory(androiddeployqt) +endif() diff --git a/src/tools/androiddeployqt/CMakeLists.txt b/src/tools/androiddeployqt/CMakeLists.txt new file mode 100644 index 0000000000..75c7115e85 --- /dev/null +++ b/src/tools/androiddeployqt/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from androiddeployqt.pro. + +##################################################################### +## androiddeployqt Binary: +##################################################################### + +add_qt_executable(androiddeployqt + SOURCES + main.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + QT_NO_FOREACH +) + +#### Keys ignored in scope 1:.:.:androiddeployqt.pro:<TRUE>: +# CONFIG = "console" +# _LOADED = "qt_app" +# _OPTION = "host_build" + +## Scopes: +##################################################################### + +extend_target(androiddeployqt CONDITION windows + COMPILE_OPTIONS + -U__STRICT_ANSI__ +) |