Android: Search for NDK and standalone toolchain in more places

Commonly used Android toolchain files that pre-date CMake upstream
support use a few environment and CMake variables as search locations.
Use them too to aid transition.
This commit is contained in:
Brad King 2016-06-06 14:55:48 -04:00
parent 29b51379de
commit 6299693f8a
1 changed files with 8 additions and 0 deletions

View File

@ -88,8 +88,16 @@ else()
set(CMAKE_ANDROID_NDK "${_ANDROID_SYSROOT_NDK}")
elseif(IS_DIRECTORY "${_ANDROID_SYSROOT_STANDALONE_TOOLCHAIN}")
set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN "${_ANDROID_SYSROOT_STANDALONE_TOOLCHAIN}")
elseif(IS_DIRECTORY "${ANDROID_NDK}")
file(TO_CMAKE_PATH "${ANDROID_NDK}" CMAKE_ANDROID_NDK)
elseif(IS_DIRECTORY "${ANDROID_STANDALONE_TOOLCHAIN}")
file(TO_CMAKE_PATH "${ANDROID_STANDALONE_TOOLCHAIN}" CMAKE_ANDROID_STANDALONE_TOOLCHAIN)
elseif(IS_DIRECTORY "$ENV{ANDROID_NDK_ROOT}")
file(TO_CMAKE_PATH "$ENV{ANDROID_NDK_ROOT}" CMAKE_ANDROID_NDK)
elseif(IS_DIRECTORY "$ENV{ANDROID_NDK}")
file(TO_CMAKE_PATH "$ENV{ANDROID_NDK}" CMAKE_ANDROID_NDK)
elseif(IS_DIRECTORY "$ENV{ANDROID_STANDALONE_TOOLCHAIN}")
file(TO_CMAKE_PATH "$ENV{ANDROID_STANDALONE_TOOLCHAIN}" CMAKE_ANDROID_STANDALONE_TOOLCHAIN)
endif()
# TODO: Search harder for the NDK or standalone toolchain.
endif()