Browse Source

Platform: (attempt to) build AndroidApplication test using CMake.

Currently fails at runtime because I forgot to link stuff.
pull/297/head
Vladimír Vondruš 8 years ago
parent
commit
eed4747f78
  1. 8
      CMakeLists.txt
  2. 13
      src/Magnum/Platform/Test/AndroidManifest.xml
  3. 3
      src/Magnum/Platform/Test/CMakeLists.txt

8
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)

13
src/Magnum/Platform/Test/AndroidManifest.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="cz.mosra.magnum.PlatformAndroidApplicationTest" android:versionCode="1" android:versionName="1.0">
<uses-feature android:glEsVersion="0x00020000" />
<application android:label="AndroidApplication Test" android:hasCode="false">
<activity android:name="android.app.NativeActivity" android:label="AndroidApplication Test">
<meta-data android:name="android.app.lib_name" android:value="PlatformAndroidApplicationTest" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

3
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)

Loading…
Cancel
Save