Font Size


Building OpenSceneGraph for Android [3.3.x - 3.4]

This file contents can be applied for version OpenSceneGraph(OSG) 3.3.2 or newer.

Prerequisites for build process

To compile OSG as a standalone library you'll only need the Android NDK. To develop applications with the library you'll also need the Android SDK

Once downloaded the NDK a new Toolchain has been provided in OSG to build using CMake:
mkdir build_android_static_gles2 && cd build_android_static_gles2
cmake .. -DANDROID_NDK=<path-to-the-android-ndk> -DCMAKE_TOOLCHAIN_FILE=../PlatformSpecifics/Android/android.toolchain.cmake  \
-DANDROID_ABI=armeabi \
make -j 8
make install
  • The OPENGL_PROFILE works as expected, changing it to "GLES1" it builds and links OSG using GLES1
  • The DYNAMIC_OPENTHREADS/DYNAMIC_OPENSCENEGRAPH parameters also allows to build the dynamic libraries
  • ANDROID_NATIVE_API_LEVEL, ANDROID_ABI are optional and should be changed accordingly to your target device