android build: Fixed program path detection

This commit is contained in:
Bernhard Miklautz 2013-11-18 19:58:01 +01:00
parent 1262d236a3
commit 7457dd3de4
2 changed files with 7 additions and 8 deletions

View File

@ -68,11 +68,11 @@ endif()
# Allow to search the host machine for git
if(ANDROID OR IOS)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER, BOTH)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
endif(ANDROID OR IOS)
include(GetGitRevisionDescription)
if(ANDROID OR IOS)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER, ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
endif(ANDROID OR IOS)
git_describe(GIT_REVISION --match "[0-9]*" --abbrev=4 --tags --always)

View File

@ -19,11 +19,10 @@ if (NOT ANDROID_NDK)
message(FATAL_ERROR "ANDROID_NDK not set but required for building android native library.")
endif()
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER, BOTH)
find_program(NDK_COMMAND ndk-build)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER, ONLY)
set(CMAKE_PROGRAM_PATH ${ANDROID_NDK})
find_program(NDK_COMMAND ndk-build CMAKE_FIND_ROOT_PATH_BOTH)
if(NDK_COMMAND STREQUAL "ANT_COMMAND-NOTFOUND")
if(NDK_COMMAND STREQUAL "NDK_COMMAND-NOTFOUND")
message(FATAL_ERROR "ndk-build not found but required to build native lib")
endif()
@ -34,9 +33,9 @@ if(ANDROID_BUILD_JAVA)
endif()
# And isn't shiped with the android ndk/sdk so
# we need to find it on the local machine
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER, BOTH)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
find_program(ANT_COMMAND ant)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER, ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
if(ANT_COMMAND STREQUAL "ANT_COMMAND-NOTFOUND")
message(FATAL_ERROR "ant not found but required to build android java")