[cmake-developers] Android Support

Brad King brad.king at kitware.com
Tue Sep 27 13:27:48 EDT 2016


On 09/27/2016 12:23 PM, Robert Dailey wrote:
> Brad, do you have a guide or walkthrough for the new CMake integration
> features of 3.7 that I can read?

It's documented in the cmake-toolchains(7) manual:

 https://cmake.org/cmake/help/git-master/manual/cmake-toolchains.7.html#cross-compiling-for-android

> Would love to see a tutorial on how it works for an out-of-the-box NDK
> setup.

The basic usage is:

```
$ cmake ../src \
  -DCMAKE_SYSTEM_NAME=Android \
  -DCMAKE_SYSTEM_VERSION=21 \
  -DCMAKE_ANDROID_NDK=/path/to/android-ndk
```

The ANDROID_NDK environment variable is among the documented ways to
specify the path to the NDK instead of defining CMAKE_ANDROID_NDK.

-Brad



More information about the cmake-developers mailing list