Skip to content

CMake scripts and patches for libraries using CMake and the Android NDK

Notifications You must be signed in to change notification settings

Discordia/android-cmake

 
 

Repository files navigation

CMake is great, and so is Android. This is a collection of CMake scripts, and
patches for common libraries that may be useful to the Android NDK community.
It is based on experience from porting OpenCV library to Android.

Main goal is to share these scripts so that devs that use CMake as their build
system may easily compile native code for Android.

This project includes ports of the follow:

* boost
* eigen
* glues

And a few samples, to get you started.

Also, used by the OpenCV project: http://opencv.org/android

------------------------------------------
THIS FORK
------------------------------------------

This fork adds the android.apk.cmake file that can be used to create an apk 
directly from CMake. It is an edited version of the Apk.cmake file that can 
be found here: https://github.com/Uroc327Mirrors/pixellight/tree/master/cmake/Android

Usage
------------------------------------------
1. Clone this project
2. Create a android ndk standalone toolchain
3. Export these paths:
export ANDROID_HOME=~/android-sdk-linux
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
4. Set these env parameters:
ANDROID_STANDALONE_TOOLCHAIN=<path to the ndk standalone toolchain>
ANDROID_CMAKE_HOME=<path to the android-cmake project>
5. Include the android.apk.cmake in a cmake CMakeLists.txt by using the line:
include("$ENV{ANDROID_CMAKE_HOME}/android.apk.cmake" REQUIRED)
6. After your .so lib has been built call the cmake macro android_create_apk(...)

Example
-----------------------------------------
An example project can be found here:
https://github.com/Discordia/android-cmake-example

About

CMake scripts and patches for libraries using CMake and the Android NDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 52.5%
  • CMake 33.2%
  • C++ 13.9%
  • Shell 0.4%