A guide to get you building OGRE from source with the default settings in the shortest possible time
2015-03-25 16:05
911 查看
|
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
相关文章推荐
- How to get the password text in a text with password property from another process using C++ - 用C++如何从不同进程获取密码框文本
- Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings.
- Advanced PIC Microcontroller Projects in C: From USB to RTOS with the PIC 18F Series
- If you whant to download SIS, JAR and JAD file from WAP you have to upload file (in the same catalog) with this: [小糊涂的灵感]
- ORA-30926: unable to get a stable set of rows in the source tables
- The source file is different from when the module was built. Would you like the debugger to use it anyway?
- ORA-30926: unable to get a stable set of rows in the source tables
- You are *required* to use the date.timezone setting or the date_default_timezone_set() function.
- How to get the current time in milliseconds in C Programming?
- Building Web Applications With SAS/IntrNet: A Guide to the Application Dispatcher
- You are *required* to use the date.timezone setting or the date_default_timezone_set() function.
- The shortest guide to character sets you'll ever read
- How to change the default browser to debug with in Visual Studio 2008?
- How to Get Help With a Command from the Linux Terminal
- string - How to get the filename without the extension from a path in Python? - Stack Overflow
- How to use the date format that has been setup as default in Settings?
- In an iOS 5 Storyboard, how do you push a new scene to the original view controller from a Popover?
- Is it possible to get the difference from two dynamic arrays regardless of their order?
- geeksforgeeks Count all possible walks from a source to a destination with exactly k edges
- ORA-30926: unable to get a stable set of rows in the source tables