From c6e644ec7702dbe80712e775f59215ce2df0dedc Mon Sep 17 00:00:00 2001 From: jandegr Date: Wed, 2 May 2018 21:22:17 +0200 Subject: rework:android:Move build system from ant to grandle (#553) rework:android:Move build system from ant to grandle --- CMakeLists.txt | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index f4ce4cc97..03a2fd004 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -682,27 +682,34 @@ if (HAS_IFADDRS) endif(HAS_IFADDRS) if(ANDROID) - find_program(ANDROID_LOCATION NAMES android android.bat) - find_program(ANT_LOCATION NAMES ant) - if (NOT ANT_LOCATION) - message_error("Could not find ant. Please install ant and add it to the search path.") - else() - execute_process(COMMAND ${ANT_LOCATION} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake RESULT_VARIABLE ANT_VERSION_OK OUTPUT_QUIET ERROR_QUIET) - if(ANT_VERSION_OK GREATER 0) - message(WARNING "Old ant version detected. If you need crash reporter, update to at least ant 1.8") + message(STATUS "Using generator "${CMAKE_GENERATOR}) + if (NOT ${CMAKE_GENERATOR} STREQUAL Ninja) + find_program(ANDROID_LOCATION NAMES android android.bat) + find_program(ANT_LOCATION NAMES ant) + if (NOT ANT_LOCATION) + message_error("Could not find ant. Please install ant and add it to the search path.") + else() + execute_process(COMMAND ${ANT_LOCATION} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cmake RESULT_VARIABLE ANT_VERSION_OK OUTPUT_QUIET ERROR_QUIET) + if(ANT_VERSION_OK GREATER 0) + message(WARNING "Old ant version detected. If you need crash reporter, update to at least ant 1.8") + endif() endif() - endif() - if (NOT ANDROID_LOCATION) - message_error( "Could not find 'Android SDK and AVD Manager'. Please install the android sdk and add the /tools directory to the search path.") - endif() - set(XSLTS "android;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process") + if (NOT ANDROID_LOCATION) + message_error( "Could not find 'Android SDK and AVD Manager'. Please install the android sdk and add the /tools directory to the search path.") + endif() + set(XSLTS "android;${XSLTS}" CACHE STRING "define a semicolon seperated list of XSLTs to process") + endif (NOT ${CMAKE_GENERATOR} STREQUAL Ninja) list(APPEND NAVIT_LIBS log) set(HAVE_API_ANDROID 1) set_with_reason(speech/cmdline "Android detected" FALSE) set_with_reason(graphics/null "Android detected" FALSE) - set_with_reason(graphics/android "Android detected, NDK:${ANDROID_NDK_API_VERSION}, API:${ANDROID_API_VERSION}" TRUE) - set_with_reason(speech/android "Android detected, NDK:${ANDROID_NDK_API_VERSION}, API:${ANDROID_API_VERSION}" TRUE) - set_with_reason(vehicle/android "Android detected, NDK:${ANDROID_NDK_API_VERSION}, API:${ANDROID_API_VERSION}" TRUE) + set_with_reason(graphics/android "Android detected" TRUE) + set_with_reason(speech/android "Android detected" TRUE) + set_with_reason(vehicle/android "Android detected" TRUE) + set_with_reason(vehicle/file "Android detected" FALSE) + set_with_reason(map/filter "Android detected" FALSE) + set_with_reason(USE_NATIVE_LANGUAGE_SUPPORT "Android detected" TRUE) +# set_with_reason(plugin/pedestrian "Android detected" TRUE) set(SHARED_LIBNAVIT TRUE) add_feature(XPM2PNG "Android detected" TRUE) -- cgit v1.2.1