cmake_minimum_required(VERSION 3.1) set(ANDROID True) set(ANDROID_ABI "x86") set(ANDROID_PLATFORM "android-24") set(ANDROID_STL "c++_static") set(ANDROID_DEPRECATED_HEADERS ON) set(ANDROID_STL_FORCE_FEATURES ON) 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 ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "-D__ANDROID__ -D__ANDROID_API__=24 -fsigned-char ${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)