cmake_minimum_required(VERSION 3.1) set(ANDROID True) set(ANDROID_ABI "armeabi-v7a") set(ANDROID_PLATFORM "android-24") set(ANDROID_STL "c++_static") set(ANDROID_DEPRECATED_HEADERS ON) set(ANDROID_STL_FORCE_FEATURES ON) set(ANDROID_ARM_NEON TRUE) include("$ENV{ANDROID_NDK}/build/cmake/android.toolchain.cmake") # for android-21 # yolo to fix some boost and stdlib definitions while linking libkernel.so that required these two flags defined set(CMAKE_C_FLAGS "-D__ANDROID__ -D__ANDROID_API__=24 -fsigned-char -mfloat-abi=softfp -mfpu=neon ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "-D__ANDROID__ -D__ANDROID_API__=24 -fsigned-char -mfloat-abi=softfp -mfpu=neon ${CMAKE_CXX_FLAGS}") # Set by the Android toolchain but prevent to find Boost_INCLUDE_DIR, so we change the values set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE BOTH)