[cmake-developers] Android Support

Robert Dailey rcdailey.lists at gmail.com
Thu Oct 20 16:19:11 EDT 2016


On Thu, Oct 20, 2016 at 2:51 PM, Brad King <brad.king at kitware.com> wrote:
> On 10/20/2016 03:35 PM, Robert Dailey wrote:
>> So using takanome's cmake toolchain, he had support for native app
>> glue. Does CMake offer support for this now? I was able to generate
>> but I'm not able to load in native app glue from the NDK.
>
> We don't currently offer a first-class interface for it but the locations
> are available relative to CMAKE_ANDROID_NDK:
>
> ```
> include_directories("${CMAKE_ANDROID_NDK}/sources/android/native_app_glue")
> set(my_sources ...
>   ${CMAKE_ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c
>   )
> ```
>
> Similarly for cpufeatures and ndk_helper.
>
> That is why
>
>  https://github.com/taka-no-me/android-cmake/blob/master/AndroidNdkModules.cmake
>
> simply wraps around hard-coded locations.

Thanks a bunch Brad. I simply modified AndroidNdkModules.cmake to use
CMAKE_ANDROID_NDK and it works perfect now.

Another question: Will CMake's android support only work with official
NDK releases? Or can I expect it to function with unofficial NDKs such
as Crystax?


More information about the cmake-developers mailing list