Hi Robert et al,

Just to add/emphasize some points on Rafa's submission:

The general cmake code becomes cleaner, putting all the Android stuff in
the toolchain let us to maintain it better. Also we could add different
toolchains for different Android versions.
Maybe be this approach could be used too for other platforms, like MacOSX
or iOS, not having to tweak CMake stuff each time a new OSX/IOS version is
released (we could add a new toolchain). Also it would make thinner the
current CMake code (that is a already a little monster, you know).

Other point is that having the OSG libraries in android as dynamic could
reduce quite a lot the size of the final app, which is a good thing.

It would be great if somebody could test this submission.

Cheers.


2014-11-13 8:45 GMT+01:00 Rafa Gaitan <[email protected]>:

> Hi Robert,
>
> I finally had some time to change the build system for Android using a
> Toolchain, which, I think, will be easier to maintain and uses cmake
> standard system to build it.
>
> My changes:
> -------------------
> - I changed the cmake files and added a toolchain for building OSG in
> Android. The toolchain is based on the one used at OpenCV. For building OSG
> for android you just need to do:
>
>     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
>
>                   -DOPENGL_PROFILE="GLES2"
>                   -DDYNAMIC_OPENTHREADS=OFF
>                   -DDYNAMIC_OPENSCENEGRAPH=OFF
>                   -DANDROID_NATIVE_API_LEVEL=15 # optional
>                   -DANDROID_ABI=armeabim #optional
>                   -DCMAKE_INSTALL_PREFIX=<path-to-the-install-path>
> #optional
> 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
>
> - I also added some build fixes for android related to the texture formats
> and added some missing USE_OSG_SERIALIZER_WRAPPER in the osg serializer
> library to support loading osgb files in static.
> -----------
>
> I haven't updated the android examples yet, I've been using osgAndroid
> library which I'm also adding support to GLES2 to test it. I will send the
> modified examples as soon as possible.
>
> I hope everyone finds this useful!
>
> Regards,
> Rafa.
>
> --
> Rafael Gaitán Linares
> CTO at Mirage Technologies S.L - http://www.mirage-tech.com
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
Jordi Torres
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to