History: Building Ogre3D 1.9 Statically in Mac OS X (Yosemite)
Preview of version: 20
- «
- »
The idea of this tutorial is to help you build Ogre3D 1.9 statically in Mac OS X (Yosemite). Additionally this tutorial will explain you how to run your first application from scratch using CMake and the QtCreator IDE.
Table of contents
Prerequisites
- You need to have a basic C++ background.
- Basic knowledge about how to use a terminal in Mac OS X (create folders, list directory contents, run commands, etc.).
- An Internet connection (this sounds obvious, but it’s better to clarify 😊 ).
- Have the following software installed (there are no specific restrictions regarding the versions used, but it's better to use the latest):
- Xcode.
- Mercurial.
- QtCreator.
- CMake.
- When this tutorial refers to the terminal, it's refering to the Mac OS X Terminal.
- When entering a command in the terminal, this tutorial refers to the current path location with the following notation:
$> cd /folder1/folder2 /folder1/folder2 $> pwd /folder1/folder2
Building Ogre
First, create a folder where the whole Ogre3D project will live:
$> sudo mkdir -p /opt/dev
You can create this folder in another location if you wish. This is not a blocker. The important thing is that you keep in mind where the folder was created to use it from now on.
Downloading Ogre3D’s Dependencies
Create the folder where the dependencies will reside:
/opt/dev/ $> mkdir dependencies
Go to the following link and download ogre3D’s dependencies:
Unzip the file you downloaded. This will contain a folder called Dependencies. Copy the content of that folder to the following location:
/opt/dev/dependencies
You should have something like this:
These dependencies include:
- Boost: It’s a set of open source libraries that extend the functionality of C++.
- Freeimage: it’s an Open Source library project for developers who would like to support popular graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications.
- Freetype: It’s is a freely available software library to render fonts.
- OIS: It’s a code library for constructing a human-computer interface with input devices such as a keyboard, mouse or game controller.
- zlib: It’s a software library used for data compression.
- zziplib: it offers the ability to easily extract data from files archived in a single zip file.
The previous downloaded dependencies are static libraries (end up with the extension .a). Normally in other platforms when you build a library for 32 and 64 bits you end up with two different library files (one for 32 and other for 64). Here in Mac OS X, you can build for 32 AND 64 bits and you end up with a single file. That single file is what is called a “flat” binary or a “universal” binary. In order to check if a library is for 32 bits or 64 bits or both, just run the following command in a terminal:
/opt/dev/dependencies/lib/Release $> lipo -info libOIS.a Architectures in the fat file: libOIS.a are: x86_64 i386