summaryrefslogtreecommitdiff
path: root/CMake/android.cmake
diff options
context:
space:
mode:
authorMatthias Melcher <git@matthiasm.com>2019-01-16 01:25:59 +0100
committerMatthias Melcher <git@matthiasm.com>2019-01-16 01:25:59 +0100
commit6de1c93e545e8100a4e907938dccd9b0564e12a2 (patch)
treef9f0160239757d24cbf9ca84f25f2fe36e88174f /CMake/android.cmake
parenta4fc8b06e1d3f39b413a19174cb661f198759793 (diff)
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.
Diffstat (limited to 'CMake/android.cmake')
-rw-r--r--CMake/android.cmake70
1 files changed, 70 insertions, 0 deletions
diff --git a/CMake/android.cmake b/CMake/android.cmake
index 75b3d4f4d..2ab4c4528 100644
--- a/CMake/android.cmake
+++ b/CMake/android.cmake
@@ -96,3 +96,73 @@ configure_file(
@ONLY
)
+
+macro(CREATE_ANDROID_IDE_FOR_TEST NAME SOURCES LIBRARIES)
+
+ message(STATUS "Creating Android IDE for ${NAME}")
+ set (ANDROID_APP_NAME ${NAME})
+
+ configure_file(
+ "${CMAKE_SOURCE_DIR}/CMake/Android/app.build.gradle.in"
+ "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/build.gradle"
+ @ONLY
+ )
+
+ configure_file(
+ "${CMAKE_SOURCE_DIR}/CMake/Android/AndroidManifest.xml.in"
+ "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/AndroidManifest.xml"
+ @ONLY
+ )
+
+
+ configure_file(
+ "${CMAKE_SOURCE_DIR}/CMake/Android/Roboto-Regular.ttf"
+ "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/assets/fonts/Roboto-Regular.ttf"
+ COPYONLY
+ )
+
+ configure_file(
+ "${CMAKE_SOURCE_DIR}/CMake/Android/mdpi.ic_launcher.png"
+ "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/mipmap-mdpi/ic_launcher.png"
+ COPYONLY
+ )
+
+ configure_file(
+ "${CMAKE_SOURCE_DIR}/CMake/Android/hdpi.ic_launcher.png"
+ "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/mipmap-hdpi/ic_launcher.png"
+ COPYONLY
+ )
+
+ configure_file(
+ "${CMAKE_SOURCE_DIR}/CMake/Android/xhdpi.ic_launcher.png"
+ "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/mipmap-xhdpi/ic_launcher.png"
+ COPYONLY
+ )
+
+ configure_file(
+ "${CMAKE_SOURCE_DIR}/CMake/Android/xxhdpi.ic_launcher.png"
+ "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/mipmap-xxhdpi/ic_launcher.png"
+ COPYONLY
+ )
+
+ configure_file(
+ "${CMAKE_SOURCE_DIR}/CMake/Android/strings.xml.in"
+ "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/res/values/strings.xml"
+ @ONLY
+ )
+
+ configure_file(
+ "${CMAKE_SOURCE_DIR}/CMake/Android/CMakeList.txt.in"
+ "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/cpp/CMakeLists.txt"
+ @ONLY
+ )
+
+ configure_file(
+ "${CMAKE_SOURCE_DIR}/CMake/Android/HelloAndroid.cxx.in"
+ "${CMAKE_BINARY_DIR}/AndroidStudio/${ANDROID_APP_NAME}/src/main/cpp/HelloAndroid.cxx"
+ @ONLY
+ )
+
+endmacro(CREATE_ANDROID_IDE_FOR_TEST NAME SOURCES LIBRARIES)
+
+