OpenSceneGraph/CMakeModules/FindAndroidNDK.cmake
Robert Osfield b24353b12c From Rafa Gaitan and Jorge Izquierdo, build support for Android NDK.
"- In order to build against GLES1 we execute:
$ mkdir build_android_gles1
$ cd build_android_gles1
$ cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF
-DDYNAMIC_OPENSCENEGRAPH=OFF -DANDROID_NDK=<path_to_android_ndk>/
-DOSG_GLES1_AVAILABLE=ON -DOSG_GL1_AVAILABLE=OFF
-DOSG_GL2_AVAILABLE=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF -DJ=2
-DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF
$ make
 If all is correct you will have and static OSG inside:
build_android_gles1/bin/ndk/local/armeabi.

- GLES2 is not tested/proved, but I think it could be possible build
it with the correct cmake flags.
- The flag -DJ=2 is used to pass to the ndk-build the number of
processors to speed up the building.
- make install is not yet supported."
2011-03-08 16:35:37 +00:00

46 lines
1002 B
CMake

# Locate AndroidNDK
# This module defines
# ANDROID_NDK
# ANDROID_FOUND, if false, do not try to use AndroidNDK
#
FIND_PATH(ANDROID_NDK ndk-build
${ANDROID_NDK}
NO_DEFAULT_PATH
)
IF(NOT ANDROID_NDK)
FIND_PATH(ANDROID_NDK ndk-build
$ENV{ANDROID_NDK}
$ENV{ANDROID_ROOT}
NO_DEFAULT_PATH
)
ENDIF()
IF(NOT ANDROID_NDK)
FIND_PATH(ANDROID_NDK ndk-build
# search for r5b
~/android-ndk-r5b
~/android_develop/android-ndk-r5b
~/ndk-r5b
~/android_develop/ndk-r5b
# search for r5
~/android-ndk-r5
~/android_develop/android-ndk-r5
~/ndk-r5
~/android_develop/ndk-r5
# search for r4-crystax
~/android-ndk-r4-crystax
~/android_develop/android-ndk-r4-crystax
~/ndk-r4
~/android_develop/ndk-r4
)
ENDIF()
SET(ANDROID_FOUND "NO")
IF(ANDROID_NDK)
SET(ANDROID_FOUND "YES")
MESSAGE(STATUS "Android NDK found in: ${ANDROID_NDK}")
ENDIF(ANDROID_NDK)