Skip to content
thahemp edited this page Nov 24, 2015 · 1 revision

This fork of OpenSceneGraph 3.2.1 is directed solely at building for newer versions of Android. The static 3rd party dependencies are included in the repository. A build script has been provided to help ease the configuration of CMake for Android.

buildOSGAndroid.sh

#!/bin/bash

# This must match the path to your osg-android build
BASE_PATH=/home/midcon1/GIT-repos/osg-android

mkdir -p build && cd build

cmake .. \
-DOSG_BUILD_PLATFORM_ANDROID=ON \
-DDYNAMIC_OPENTHREADS=OFF \
-DDYNAMIC_OPENSCENEGRAPH=OFF \
-DOSG_GL1_AVAILABLE=OFF \
-DOSG_GL2_AVAILABLE=OFF \
-DOSG_GL3_AVAILABLE=OFF \
-DOSG_GLES1_AVAILABLE=OFF \
-DOSG_GLES2_AVAILABLE=ON \
-DOSG_GL_LIBRARY_STATIC=OFF \
-DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF \
-DOSG_GL_MATRICES_AVAILABLE=OFF \
-DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF \
-DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF \
-DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF \
-DANDROID_ABI="armeabi armeabi-v7a" \
-DANDROID_PLATFORM=19 \
-DANDROID_STL="gnustl_static" \
-DANDROID_DEBUG=ON \
-DANDROID_OPTIM_NEON=ON \
-DANDROID_OPTIM_ARM32=ON \
-DJ=8 \
-DGDAL_DIR:PATH="$BASE_PATH/3rdparty/gdal/include"

make

This script will configure and build the OpenSceneGraph library for android-19 by default. Change the ANDROID_PLATFORM CMake variable to target a different platform. Build files are generated in the ./build directory.

Clone this wiki locally