From 6de1c93e545e8100a4e907938dccd9b0564e12a2 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Wed, 16 Jan 2019 01:25:59 +0100 Subject: Android CMake: macro for multiple tests Added a macro that creates the IDE files for a named test. This is just a rough layout and will only work for the simpelest of test targets. --- CMake/Android/AndroidManifest.xml.in | 4 ++-- CMake/Android/CMakeList.txt.in | 9 ++++++--- CMake/Android/HelloAndroid.cxx.in | 2 +- CMake/Android/app.build.gradle.in | 2 +- CMake/Android/settings.gradle.in | 3 ++- CMake/Android/strings.xml.in | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) (limited to 'CMake/Android') diff --git a/CMake/Android/AndroidManifest.xml.in b/CMake/Android/AndroidManifest.xml.in index e0131f422..4e5c6154b 100644 --- a/CMake/Android/AndroidManifest.xml.in +++ b/CMake/Android/AndroidManifest.xml.in @@ -1,6 +1,6 @@ + android:value="test_@ANDROID_APP_NAME@" /> diff --git a/CMake/Android/CMakeList.txt.in b/CMake/Android/CMakeList.txt.in index 99019b009..48f8b07f0 100644 --- a/CMake/Android/CMakeList.txt.in +++ b/CMake/Android/CMakeList.txt.in @@ -27,10 +27,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") add_subdirectory(${FLTK_DIR}/ "${CMAKE_CURRENT_BINARY_DIR}/lib" EXCLUDE_FROM_ALL) # now build app's shared lib -add_library(android-hello SHARED +add_library( + test_@ANDROID_APP_NAME@ SHARED HelloAndroid.cxx) -target_include_directories(android-hello PRIVATE +target_include_directories( + test_@ANDROID_APP_NAME@ PRIVATE ${FLTK_DIR}/ ${FLTK_IDE_DIR}/ ) @@ -40,7 +42,8 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate") # add lib dependencies -target_link_libraries(android-hello +target_link_libraries( + test_@ANDROID_APP_NAME@ fltk android log diff --git a/CMake/Android/HelloAndroid.cxx.in b/CMake/Android/HelloAndroid.cxx.in index 42cdba663..e79cfcaf2 100644 --- a/CMake/Android/HelloAndroid.cxx.in +++ b/CMake/Android/HelloAndroid.cxx.in @@ -16,7 +16,7 @@ */ -#include "../../../test/button.cxx" +#include "../../../test/@ANDROID_APP_NAME@.cxx" /* diff --git a/CMake/Android/app.build.gradle.in b/CMake/Android/app.build.gradle.in index dd66c8d93..9e579a4c7 100644 --- a/CMake/Android/app.build.gradle.in +++ b/CMake/Android/app.build.gradle.in @@ -4,7 +4,7 @@ apply plugin: 'com.android.application' compileSdkVersion 25 defaultConfig { - applicationId 'org.fltk.android_hello' + applicationId 'org.fltk.@ANDROID_APP_NAME@' minSdkVersion 14 targetSdkVersion 25 externalNativeBuild { diff --git a/CMake/Android/settings.gradle.in b/CMake/Android/settings.gradle.in index 573abcb32..9cdfbec62 100644 --- a/CMake/Android/settings.gradle.in +++ b/CMake/Android/settings.gradle.in @@ -1,2 +1,3 @@ -include ':app' +include ':arc' +include ':hello' diff --git a/CMake/Android/strings.xml.in b/CMake/Android/strings.xml.in index e2f60e96f..351315218 100644 --- a/CMake/Android/strings.xml.in +++ b/CMake/Android/strings.xml.in @@ -1,4 +1,4 @@ - Hello Android + @ANDROID_APP_NAME@ -- cgit v1.2.3