[cmake-developers] A goal for a simple Android toolchain file.

Stephen Kelly steveire at gmail.com
Fri Mar 21 11:49:26 EDT 2014


Hi,

I'd like it to be this easy to create an Android toolchain file:

 set(CMAKE_SYSTEM_NAME Android)

 set(ANDROID_SDK_ROOT "/home/stephen/android/android-sdk-linux/")
 set(ANDROID_NDK_ROOT "/home/stephen/android/android-ndk-r9/")
 set(ANDROID_NDK_PLATFORM "android-18")

 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)


In order to do that, more stuff would need to be in the Android.cmake 
platform file.

The platform file I'm currently experimenting with is here:

 http://www.steveire.com/Android.cmake

I would aim to obsolete the toolchain file which is commonly used for 
Android, which is here:

 http://code.google.com/p/android-cmake/source/browse/toolchain/android.toolchain.cmake

I think part of the solution will need to be an interface in CMake for 
selecting an STL version. That will probably also be usable to select 
between libstdc++ and libc++ when using clang.

Any comments on adding that kind of thing to the Android toolchain file?

Thanks,

Steve.




More information about the cmake-developers mailing list