您的位置:首页 > 产品设计 > UI/UE

A guide to get you building OGRE from source with the default settings in the shortest possible time

2015-03-25 16:05 911 查看


Quick
Start Guide

For the impatient: Learn how to build Ogre with CMake in two minutes. If you encounter any problems or need some more advanced procedures, do read the rest of the sections below!


Introduction

This guide is designed to get you building OGRE from source with the default settings in the shortest possible time, showing you the barest minimum of CMake to do that, and minus any real discussion.
Remember that there is a lot more to the hows and whys of this process, so it's a good idea to go back to the Getting
Started With CMake page and read the whole thing when you have time.
We assume here that you've already downloaded
/ extracted the OGRE source code

into
a folder on your local machine. From here, go to the section for your platform.

WINDOWS LINUX MAC
OS X IPHONE ANDROID

Download the dependencies and extract inside the OGRE src dir. The deps are compiled for armeabi and armeabi-v7a.

http://sourceforge.net/projects/ogre/files/ogre-dependencies-android/1.9/AndroidDependencies_27_08_2013.zip/download




Building for Android on Windows host:

1. Download and install the android sdk

http://developer.android.com/sdk/index.html


2. After the install open the "Android SDK Manager" and download & install your target API.

Here we target the lowest possible API - which is API10 Android 2.3.3.

Due the usage of the native activity and the asset manager if we would skip these we could go a bit lower but that would not make much sense because OGRE still needs a decent hardware to run.

3. Now add the install directory to your enviroment variables -> ANDROID_SDK = C:\Users\wolfmanfx\AppData\Local\Android\android-sdk

Append %ANDROID_SDK%\tools and %ANDROID_SDK%\platform-tools to your PATH variable

4. Download the android ndk

Extract the content to C:/android/ndk and create a env var %ANDROID_NDK%
Add %ANDROID_NDK% to your path

http://dl.google.com/android/ndk/android-ndk-r8c-windows.zip
Android NDK revision 8b is not supported due a bug in the toolchain


5. We need ant (http://ant.apache.org/bindownload.cgi) to build projects from the command line

I use this version http://tweedo.com/mirror/apache/ant/binaries/apache-ant-1.9.1-bin.zip


Extract the content under C:/android/ant and add the bin dir to your path
Use the command "ant -version" with the windows terminal (cmd.exe) to the test version. Should look like this

Apache Ant(TM) version 1.9.1 compiled on May 15 2013


6. The build command for the deps, using Visual Studio command prompt (this is necessary only if you are building the dependencies from source)

cmake -G"NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE=..\cmake\android.toolchain.cmake -DANDROID_ABI=armeabi ..
nmake


7. The build command for ogre (for armeabi - if you want to build for armeabi v7a just remove -DANDROID_ABI=armeabi) create a build dir inside the OGRE src tree and cd to this dir and execute this command:

cmake -G"NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE=..\CMake\toolchain\android.toolchain.cmake -DOGRE_DEPENDENCIES_DIR=..\AndroidDependencies -DANDROID_ABI=armeabi -DANDROID_NATIVE_API_LEVEL=9 ..




You may have to call "nmake" after executing the cmake script.

Currently there are a couple targets in the system which you can see by typing "nmake help".

If you want to build the old OgreSampleBrowser, which you can download from the Google Play Store, you have to type "nmake SampleBrowserDummy".

nmake SampleBrowserDummy


Currently, the default value is the JNI Sample, which might not be complete just yet.



Note: standard NMake can only build one file at a time. For functionality similar to "make -j" (parallel builds), use JOM in place of the "nmake" command above. JOM can be found here: http://qt-project.org/wiki/jom



Once you have successfully built Ogre with nmake or JOM, you still need to make the SampleBrowser app itself. This is a native activity and the project resides in a "SampleBrowserNDK" subdirectory of the build directory you provided earlier. Change to this
directory, run "ndk-build all" (optionally with a "-j " option — without the quotes of course — for parallel build), and then "ant debug install" to build a debug APK and install it to your device.



Building for Android on Mac OSX host:

cmake -DCMAKE_TOOLCHAIN_FILE="`pwd`/../CMake/toolchain/android.toolchain.cmake" -DOGRE_DEPENDENCIES_DIR="`pwd`/../AndroidDependencies" -DANDROID_ABI=armeabi -DANDROID_NATIVE_API_LEVEL=9 ..


Then run the "make" included in the NDK:

android-ndk/prebuilt/darwin-x86/bin/make
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐