diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fc5473b0..0de6cab66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,14 @@ find_package(Corrade REQUIRED Utility) include(CMakeDependentOption) +# For experimental Gradle-less Android APK creation. Only with CMake > 3.7 that +# has builtin Android support -- Gradle uses 3.6 so this will nicely work in +# both cases. +if(CORRADE_TARGET_ANDROID AND CMAKE_ANDROID_NDK) + list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/toolchains/modules/") + include(UseAndroid) +endif() + # If targeting iOS, Android, Emscripten or Windows RT, set explicit OpenGL ES # support if(NOT CORRADE_TARGET_IOS AND NOT CORRADE_TARGET_ANDROID AND NOT CORRADE_TARGET_EMSCRIPTEN AND NOT CORRADE_TARGET_WINDOWS_RT) diff --git a/src/Magnum/Platform/Test/AndroidManifest.xml b/src/Magnum/Platform/Test/AndroidManifest.xml new file mode 100644 index 000000000..1a07a36ca --- /dev/null +++ b/src/Magnum/Platform/Test/AndroidManifest.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/src/Magnum/Platform/Test/CMakeLists.txt b/src/Magnum/Platform/Test/CMakeLists.txt index c13c0bfef..f3f047f9e 100644 --- a/src/Magnum/Platform/Test/CMakeLists.txt +++ b/src/Magnum/Platform/Test/CMakeLists.txt @@ -27,6 +27,9 @@ if(WITH_ANDROIDAPPLICATION) add_library(PlatformAndroidApplicationTest SHARED AndroidApplicationTest.cpp) target_link_libraries(PlatformAndroidApplicationTest PRIVATE MagnumAndroidApplication) set_target_properties(PlatformAndroidApplicationTest PROPERTIES FOLDER "Magnum/Platform/Test") + if(CMAKE_ANDROID_NDK) + android_create_apk(PlatformAndroidApplicationTest AndroidManifest.xml) + endif() endif() if(WITH_GLFWAPPLICATION)