From Rafa Gaitan, "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."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14514 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
@@ -25,14 +25,6 @@ IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
|
||||
HANDLE_MSVC_DLL()
|
||||
ENDIF()
|
||||
|
||||
IF(ANDROID)
|
||||
INSTALL (
|
||||
FILES ${TARGET_H}
|
||||
DESTINATION ${INSTALL_INCDIR}/${LIB_NAME}
|
||||
COMPONENT libopenscenegraph-dev
|
||||
)
|
||||
ELSE(ANDROID)
|
||||
|
||||
INSTALL(
|
||||
TARGETS ${LIB_NAME}
|
||||
RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT libopenscenegraph
|
||||
@@ -59,4 +51,3 @@ ELSE()
|
||||
# MESSAGE("${OSG_COMPILE_FRAMEWORKS_INSTALL_NAME_DIR}")
|
||||
ENDIF()
|
||||
|
||||
ENDIF(ANDROID)
|
||||
|
||||
@@ -216,9 +216,6 @@ MACRO(SETUP_LIBRARY LIB_NAME)
|
||||
INCLUDE_DIRECTORIES( ${GLCORE_INCLUDE_DIR} )
|
||||
ENDIF()
|
||||
|
||||
IF(ANDROID)
|
||||
SETUP_ANDROID_LIBRARY(${LIB_NAME})
|
||||
ELSE()
|
||||
SET(TARGET_NAME ${LIB_NAME} )
|
||||
SET(TARGET_TARGETNAME ${LIB_NAME} )
|
||||
ADD_LIBRARY(${LIB_NAME}
|
||||
@@ -246,7 +243,6 @@ MACRO(SETUP_LIBRARY LIB_NAME)
|
||||
ENDIF(TARGET_LIBRARIES_VARS)
|
||||
LINK_CORELIB_DEFAULT(${LIB_NAME})
|
||||
|
||||
ENDIF()
|
||||
INCLUDE(ModuleInstall OPTIONAL)
|
||||
ENDMACRO(SETUP_LIBRARY LIB_NAME)
|
||||
|
||||
@@ -255,10 +251,6 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
INCLUDE_DIRECTORIES( ${GLCORE_INCLUDE_DIR} )
|
||||
ENDIF()
|
||||
|
||||
IF(ANDROID)
|
||||
SETUP_ANDROID_LIBRARY(${TARGET_DEFAULT_PREFIX}${PLUGIN_NAME})
|
||||
ELSE()
|
||||
|
||||
SET(TARGET_NAME ${PLUGIN_NAME} )
|
||||
|
||||
#MESSAGE("in -->SETUP_PLUGIN<-- ${TARGET_NAME}-->${TARGET_SRC} <--> ${TARGET_H}<--")
|
||||
@@ -340,7 +332,6 @@ MACRO(SETUP_PLUGIN PLUGIN_NAME)
|
||||
ARCHIVE DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT libopenscenegraph-dev
|
||||
LIBRARY DESTINATION lib${LIB_POSTFIX}/${OSG_PLUGINS} COMPONENT ${PACKAGE_COMPONENT})
|
||||
ENDIF(WIN32)
|
||||
ENDIF()
|
||||
ENDMACRO(SETUP_PLUGIN)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user