Nobuaki Sukegawa | ca93936 | 2015-11-14 00:23:40 +0900 | [diff] [blame] | 1 | set(ANDROID_NDK "/opt/android-ndk" CACHE) |
| 2 | set(ANDROID_PLATFORM "android-15" CACHE) |
| 3 | set(ANDROID_ARCH "arch-arm" CACHE) |
| 4 | set(ANDROID_TOOL_ARCH "android-arm" CACHE) |
| 5 | set(ANDROID_CPU "armeabi-v7a" CACHE) |
| 6 | set(ANDROID_GCC_VERSION 4.9 CACHE) |
| 7 | set(HOST_ARCH linux-x86_64 CACHE) |
| 8 | |
| 9 | set(CMAKE_SYSTEM_NAME Android) |
| 10 | set(ANDROID_SYSROOT "${ANDROID_NDK}/platforms/${ANDROID_PLATFORM}/${ANDROID_ARCH}") |
| 11 | set(ANDROID_TRIPLET arm-linux-androideabi) |
| 12 | set(ANDROID_STL "${ANDROID_NDK}/sources/cxx-stl/gnu-libstd++/${ANDROID_GCC_VERSION}") |
| 13 | |
| 14 | set(_COMPILER_ROOT ${ANDROID_NDK}/prebuilt/${ANDROID_TRIPLET}-${ANDROID_GCC_VERSION}/prebuilt/${HOST_ARCH}) |
| 15 | set(CMAKE_C_COMPILER ${_COMPILER_ROOT}/bin/${ANDROID_TRIPLET}-gcc) |
| 16 | set(CMAKE_CXCX_COMPILER ${_COMPILER_ROOT}/bin/${ANDROID_TRIPLET}-g++) |
| 17 | |
| 18 | include_directories( |
| 19 | ${ANDROID_STL}/include |
| 20 | ${ANDROID_STL}/libs/${ANDROID_CPU}/include) |
| 21 | |
| 22 | set(CMAKE_FIND_ROOT_PATH ${ANDROID_SYSROOT}) |
| 23 | |
| 24 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) |
| 25 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) |
| 26 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |