History: Building Ogre3D 1.9 Statically in Mac OS X (Yosemite)
Source of version: 18
- «
- »
Copy to clipboard
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.
{maketoc}
! 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:
{CODE(ln=0, wrap="1", colors="c++")}
$> cd /folder1/folder2
/folder1/folder2 $> pwd
/folder1/folder2
{CODE}
---
! Building Ogre
First, create a folder where the whole Ogre3D project will live:
{CODE(wrap="1", colors="c++")}
$> sudo mkdir -p /opt/dev
{CODE}
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:
{CODE(wrap="1", colors="c++")}/opt/dev/ $> mkdir dependencies{CODE}
Go to the following link and download ogre3D’s dependencies:
http://sourceforge.net/projects/ogre/files/ogre-dependencies-mac/1.9/OgreDependencies_OSX_libc%2B%2B_20130610.zip/download
Unzip the file you downloaded. This will contain a folder called __Dependencies__. Copy the content of that folder to the following location:
{CODE(wrap="1", colors="c++")}/opt/dev/dependencies{CODE}
You should have something like this:
{IMG(fileId="2214",rel="box[g]")}{IMG}
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 or 64 or both, just run the following command in a terminal: