[solved][Android] Boost for Ogre

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
Post Reply
Emerich
Halfling
Posts: 64
Joined: Wed Oct 24, 2012 10:59 am
x 12

[solved][Android] Boost for Ogre

Post by Emerich »

Hi there!

Has anyone actually managed to get boost compiled for Android and then used by Ogre?
I did search quite a lot but couldn't find a proper cmake version or android version of boost (1_51)

I'd really appreciate help if anyone managed to do that.
EDIT:
Using the documentation from here: http://code.google.com/p/android-cmake/ ... hain.cmake
And some bugfixing in the findboost.cmake I managed to find some boost libraries with find_path (... ) and find_library (... )
Apparently the toolchain changed some env variables that caused the functions to misbehave.
Now that means I can link them into my project. Yay for more cmake learning.

If anyone cares, I'll write down my "adventure" here so other people might profit.

In case you were wondering: Adding NO_CMAKE_FIND_ROOT_PATH as an option to the find_path and find_library calls in FindBoost.cmake allows the script to find boost when called after/with/whatever the android.toolchain - At least that did it for me.
Last edited by Emerich on Mon Mar 18, 2013 12:11 pm, edited 1 time in total.
Emerich
Halfling
Posts: 64
Joined: Wed Oct 24, 2012 10:59 am
x 12

Re: [Android] Boost for Ogre

Post by Emerich »

I actually managed to get the BOOST-ed Ogre to work on Android.
A further issue was that the scripts don't add the necessary boost files to the make script - you need to do that by hand (or someone with a clue needs to change the scripts properly)

Code: Select all

LOCAL_PATH := $(call my-dir)
    include $(CLEAR_VARS)
    LOCAL_MODULE    := OgreSampleBrowser

    LOCAL_LDLIBS	:= -landroid -lc -lm -ldl -llog -lEGL -lGLESv2
    LOCAL_LDLIBS	+= -LC:/master/svn/ogre/ogre/androidbuild/lib -LC:/master/svn/boost/boost_1_45_0/libs -LC:/master/svn/boost/boost_1_45_0/libs/armeabi-v7a -LC:/master/svn/ogre/ogre/AndroidDependencies/lib/armeabi-v7a
	LOCAL_LDLIBS += -lSample_CameraTrack -lSample_CelShading -lSample_Character -lSample_Compositor -lSample_Lighting -lSample_BezierPatch -lSample_CubeMapping -lSample_DynTex
	LOCAL_LDLIBS += -lSample_FacialAnimation -lSample_Fresnel -lSample_Grass -lSample_ParticleFX -lSample_Lighting -lSample_MeshLod -lSample_SkyBox -lSample_SkyPlane -lSample_SkyDome -lSample_Smoke
    LOCAL_LDLIBS	+= -lPlugin_ParticleFXStatic -lPlugin_OctreeSceneManagerStatic -lRenderSystem_GLES2Static -lOgreRTShaderSystemStatic -lOgreOverlayStatic -lOgreMainStatic
    LOCAL_LDLIBS	+= -lzzip -lz -lFreeImage -lfreetype -lOIS 
	LOCAL_LDLIBS += -lboost_date_time -lboost_filesystem  -lboost_iostreams -lboost_program_options -lboost_regex -lboost_signals -lboost_system -lboost_thread	C:/master/svn/ogre/ogre/androidbuild/systemlibs/armeabi-v7a/libsupc++.a C:/master/svn/ogre/ogre/androidbuild/systemlibs/armeabi-v7a/libstdc++.a C:/master/svn/ogre/ogre/androidbuild/SampleBrowserNDK/obj/local/armeabi-v7a/libcpufeatures.a
    LOCAL_STATIC_LIBRARIES := android_native_app_glue cpufeatures
    
    LOCAL_CFLAGS := -DGL_GLEXT_PROTOTYPES=1 -IC:/master/svn/boost/boost_1_45_0/ -IC:/master/svn/boost/boost_1_45_0/boost -IC:/master/svn/ogre/ogre/androidbuild/include -IC:/master/svn/ogre/ogre/OgreMain/include -IC:/master/svn/ogre/ogre/RenderSystems/GLES2/include -IC:/master/svn/ogre/ogre/RenderSystems/GLES2/include/EGL
    LOCAL_CFLAGS += -IC:/android/ndk/sources/cpufeatures -IC:/master/svn/ogre/ogre/Components/RTShaderSystem/include -IC:/master/svn/ogre/ogre/Components/Overlay/include 
    LOCAL_CFLAGS += -IC:/master/svn/ogre/ogre/PlugIns/ParticleFX/include -IC:/master/svn/ogre/ogre/PlugIns/OctreeSceneManager/include 
    LOCAL_CFLAGS += -IC:/master/svn/ogre/ogre/AndroidDependencies/include -IC:/master/svn/ogre/ogre/AndroidDependencies/include/OIS -IC:/master/svn/ogre/ogre/androidbuild/Samples/include
    LOCAL_CFLAGS += -fexceptions -frtti -x c++ -D___ANDROID___ -DANDROID -DZZIP_OMIT_CONFIG_H -DUSE_RTSHADER_SYSTEM=1 
    
	LOCAL_PATH := C:/master/svn/ogre/ogre/Samples/Browser/src
	LOCAL_SRC_FILES := SampleBrowser.cpp
        
    include $(BUILD_SHARED_LIBRARY) 
      
    $(call import-module,android/cpufeatures) 
    $(call import-module,android/native_app_glue) 
Needless to say, you have to put your folders in there.
ddeath
Kobold
Posts: 37
Joined: Sat Sep 28, 2013 9:15 am
x 2

Re: [solved][Android] Boost for Ogre

Post by ddeath »

Hi,
please where did you added this lines?

Thanks
Linux Mint 16
CPU: i5-430M
GPU: ATI Mobility Radeon HD 5650
Emerich
Halfling
Posts: 64
Joined: Wed Oct 24, 2012 10:59 am
x 12

Re: [solved][Android] Boost for Ogre

Post by Emerich »

Hey,

I didn't work on this for ages and unfortunately don't have the project on my pc currently.

If you search for something like *make* you should find the make file in your ogre/build/ folder (unless too much changed nowadays and i'm talking deprecated paths )
Post Reply