forked from taka-no-me/android-cmake
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathREADME
44 lines (35 loc) · 1.6 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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