Android CMake: fix, more autogenerated files

Fixed a bug that would cause an error is Android Build was NOT
defined. Creating list of test targets automatically.
This commit is contained in:
Matthias Melcher 2019-01-16 02:12:29 +01:00
parent 6de1c93e54
commit 563baced13
4 changed files with 24 additions and 4 deletions

View File

@ -1,3 +1 @@
include ':arc'
include ':hello'

View File

@ -163,6 +163,15 @@ macro(CREATE_ANDROID_IDE_FOR_TEST NAME SOURCES LIBRARIES)
@ONLY
)
file(APPEND "${CMAKE_BINARY_DIR}/AndroidStudio/settings.gradle" "include ':${ANDROID_APP_NAME}'\n")
endmacro(CREATE_ANDROID_IDE_FOR_TEST NAME SOURCES LIBRARIES)
macro(CREATE_ANDROID_IDE_WRAPUP)
message(STATUS "Wrapping up Android IDE creation")
endmacro(CREATE_ANDROID_IDE_WRAPUP)

View File

@ -103,6 +103,13 @@ if(OPTION_BUILD_EXAMPLES)
add_subdirectory(test)
endif(OPTION_BUILD_EXAMPLES)
#######################################################################
# Android Studio wrapup
#######################################################################
if (OPTION_CREATE_ANDROID_STUDIO_IDE)
CREATE_ANDROID_IDE_WRAPUP()
endif (OPTION_CREATE_ANDROID_STUDIO_IDE)
#######################################################################
# installation
#######################################################################

View File

@ -38,12 +38,18 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}
)
#######################################################################
## testing creation of Android Studio IDE files
if (OPTION_CREATE_ANDROID_STUDIO_IDE)
CREATE_ANDROID_IDE_FOR_TEST(arc arc.cxx fltk)
CREATE_ANDROID_IDE_FOR_TEST(hello hello.cxx fltk)
CREATE_ANDROID_IDE_FOR_TEST(input input.cxx fltk)
endif (OPTION_CREATE_ANDROID_STUDIO_IDE)
#######################################################################
if(NOT ANDROID)
CREATE_EXAMPLE(adjuster adjuster.cxx fltk)
CREATE_EXAMPLE(arc arc.cxx fltk)
CREATE_ANDROID_IDE_FOR_TEST(arc arc.cxx fltk)
CREATE_ANDROID_IDE_FOR_TEST(hello hello.cxx fltk)
CREATE_EXAMPLE(animated animated.cxx fltk)
CREATE_EXAMPLE(ask ask.cxx fltk)
CREATE_EXAMPLE(bitmap bitmap.cxx fltk)