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."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14514 16af8721-9629-0410-8352-f15c8da7e697
"There is a redundant cmake code at the end of osgViewer cmake script. The install command is issued in SETUP_LIBRARY macro."
"I spotted this when i tried a make install on the android port :) I saw some weird copy commands of osgViewer headers.
I managed to get all osg headers copied to cmake_install_prefix/include upon make install, but i can't (yet) get the libraries to be copied to cmake_install_prefix/lib (see attached files)"
SETUP_EXE, in order to have a unique entry point to build the
libraries. With this changes the android integration will be less
painful (currently is a big IF(ANDROID) for each CMakeLists.txt) and
more maintainable in the future. I hope next submissions will be for
supporting android from my colleague Jorge.
"
"changed the CmakeFiles for OpenThreads and the
osg-frameworks, so they are versioned by OPENSCENEGRAPH_SOVERSION. "
And from a later email:
"Attached you'll find a fixed version of ModulInstall.cmake. Hopefully it
works for old CMake-versions. I removed the offending line, and the
compile went fine on my end."
Mathieu Marache, he added the last missing piece to this puzzle.
I think it is safe to commit these changes to trunk, as the traditional
way via dylibs should work as before.
Here's some more info how to get frameworks:
With these modifications it is possible to compile frameworks on OS X,
when you set the Cmake-option OSG_COMPILE_FRAMEWORKS to true. If you
want to embed the frameworks in your app-bundle make sure to set
OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR accordingly.
You'll have to build the install-target of the generated xcode-projects
as this sets the install_name_dirs of the frameworks and plugins."
consider these initial cpack support scripts. It is hidden behind a
BUILD_PACKAGES option so won't affect the normal user. The submission
1) set the COMPONENT attribute on all cmake install commands.
COMPONENT names are according to
http://www.openscenegraph.org/projects/osg/wiki/Community/Packaging
2) provide cmake script and a template for creating CPack
configuration files. It will generate target for creating packages
with everything that gets "installed" (make package on unx, project
PACKAGE in MSVC) plus targets for generating one package per COMPONENT
(i.e. libopenscenegraph-core etc.).
I have temporariliy uploaded some examples to
http://www.openscenegraph.org/projects/osg/wiki/Community/People/MattiasHelsing
If this submission makes it into svn we can develop it to generate
rpms, installers for windows and mac (I know at least J-S don't like
these but there may be others who do ;) and even DEBs (not sure if we
can make them "ubuntu-ready" but they eventually may - at least we
could put a deb on the website)"