set(JAVA_HOME "/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home")
set(GRADLE_HOME "$ENV{HOME}/gradle-2.4" CACHE PATH "Gradle path")
set(ANDROID_HOME "$ENV{HOME}/android-sdk-macosx" CACHE PATH "Android SDK path")
set(ANDROID_NDK_HOME "$ENV{HOME}/android-ndk-r13b" CACHE PATH "Android NDK path")
set(ANDROID_TOOLCHAIN_ROOT "$ENV{HOME}/android-toolchain" CACHE PATH "Android toolchain path")
set(ANDROID_ABI "armeabi-v7a" CACHE STRING "Android ABI")

set(LFL_ANDROID 1)
#include(core/CMake/LFLOS.cmake)
if(NOT LFL_OS)
  if(APPLE)
    set(LFL_OS osx)
  elseif(UNIX)
    set(LFL_OS linux)
  elseif(WIN32 OR WIN64)
    set(LFL_OS win32)
  else()
    MESSAGE(FATAL_ERROR "unknown OS")
  endif()
endif()

set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_C_COMPILER ${ANDROID_TOOLCHAIN_ROOT}/bin/arm-linux-androideabi-gcc CACHE PATH "C compiler")
set(CMAKE_CXX_COMPILER ${ANDROID_TOOLCHAIN_ROOT}/bin/arm-linux-androideabi-g++ CACHE PATH "C++ compiler")
set(CMAKE_AR ${ANDROID_TOOLCHAIN_ROOT}/bin/arm-linux-androideabi-ar CACHE PATH "archive")
set(CMAKE_RANLIB ${ANDROID_TOOLCHAIN_ROOT}/bin/arm-linux-androideabi-ranlib CACHE PATH "ranlib")
set(CMAKE_LINKER ${ANDROID_TOOLCHAIN_ROOT}/bin/arm-linux-androideabi-ld CACHE PATH "linker")

set(ENV_CC "${ANDROID_TOOLCHAIN_ROOT}/bin/arm-linux-androideabi-gcc")
set(ENV_CXX "${ANDROID_TOOLCHAIN_ROOT}/bin/arm-linux-androideabi-g++")
set(ENV_CPP "${ANDROID_TOOLCHAIN_ROOT}/bin/arm-linux-androideabi-cpp")
set(ENV_CXXCPP "${ANDROID_TOOLCHAIN_ROOT}/bin/arm-linux-androideabi-cpp")
set(ENV_AR "${ANDROID_TOOLCHAIN_ROOT}/bin/arm-linux-androideabi-ar")
set(ENV_RANLIB "${ANDROID_TOOLCHAIN_ROOT}/bin/arm-linux-androideabi-ranlib")
set(ENV_CFLAGS "-isysroot ${ANDROID_TOOLCHAIN_ROOT}/sysroot")
set(ENV_CXXFLAGS "-isysroot ${ANDROID_TOOLCHAIN_ROOT}/sysroot")
set(ENV_LDFLAGS "-isysroot ${ANDROID_TOOLCHAIN_ROOT}/sysroot")
set(CONFIGURE_OPTIONS "--host=arm")
set(CONFIGURE_ENV CC=${ENV_CC} CXX=${ENV_CXX} CPP=${ENV_CPP} CXXCPP=${ENV_CXXCPP} AR=${ENV_AR} RANLIB=${ENV_RANLIB}
    CFLAGS=${ENV_CFLAGS} CXXFLAGS=${ENV_CXXFLAGS} LDFLAGS=${ENV_LDFLAGS})
set(CONFIGURE_CMAKE -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})

set(C_LIBRARY ${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/lib/libc.so)
set(M_LIBRARY ${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/lib/libm.so)
set(ZLIB_INCLUDE_DIR ${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/include)
set(ZLIB_LIBRARY ${ANDROID_TOOLCHAIN_ROOT}/sysroot/usr/lib/libz.so)
