From 2b0796eb7dececa2e8d236a4a4d4e723c75cb4eb Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 28 Jan 2015 13:40:47 -0800 Subject: [PATCH] simplify cmake call for android build --- BUILD_ANDROID.md | 3 +-- CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/BUILD_ANDROID.md b/BUILD_ANDROID.md index c4c4c27dd7..928f5dca36 100644 --- a/BUILD_ANDROID.md +++ b/BUILD_ANDROID.md @@ -138,5 +138,4 @@ The following must be set in your environment: The following must be passed to CMake when it is run: -* CMAKE_TOOLCHAIN_FILE - full path to the android.toolchain.cmake file that is included in this repository (/cmake/android/android.toolchain.cmake) -* ANDROID_NATIVE_API_LEVEL - the API level you want to use (this should be 19 for GearVR) +* USE_ANDROID_TOOLCHAIN - set to true to build for Android \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 037f91c565..6544b11114 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,10 @@ cmake_minimum_required(VERSION 2.8.12.2) +if (USE_ANDROID_TOOLCHAIN) + set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/android/android.toolchain.cmake") + set(ANDROID_NATIVE_API_LEVEL 19) +endif () + if (WIN32) cmake_policy(SET CMP0020 NEW) endif (WIN32)