Downloading and Compiling under macOS: Difference between revisions

From Arx Libertatis Wiki
Jump to navigation Jump to search
(First draft of instructions for Mac setup)
 
(Completed instructions for Mac setup)
Line 3: Line 3:
Specific instructions are given for a cleanly installed Lion 10.7.3 system, but the procedure should be similar for other versions.
Specific instructions are given for a cleanly installed Lion 10.7.3 system, but the procedure should be similar for other versions.


== Manual installation ==
== Setting Up the Build Environment ==
 
=== Setting Up the Build Environment ===


To download and compile Arx Libertatis you will need the following tools:
To download and compile Arx Libertatis you will need the following tools:
* <code>Xcode</code>
* <code>Xcode</code> Tested with 4.3, install the latest from the App Store (https://developer.apple.com/xcode/)
** Install command line tools from Xcode, in Preferences -> Download
** Install command line tools from Xcode, in Preferences -> Download
** Set the path to the Xcode folder: sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
** Set the path to the Xcode folder: <code>sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer</code>
* <code>github for Mac - Also install the command line tools</code>
* <code>github for Mac</code> Also install the command line tools (http://mac.github.com/)
* <code>cmake</code> (version 2.8 or later)
* <code>cmake</code> should be build from source (http://www.cmake.org/)
* <code>MacPorts</code>
* <code>MacPorts</code> (http://www.macports.org/)
* a <code>gcc</code> or <code>clang</code> toolchain
 
== Libraries ==
* <code>SDL</code> 1.2 (http://www.libsdl.org/)
* <code>GLEW</code> (http://glew.sourceforge.net/)
* <code>DevIL</code> (http://openil.sourceforge.net/)
* <code>zlib</code> (http://zlib.net/)
* <code>Boost</code> headers and program_options library (http://www.boost.org/)
* <code>Freetype</code> (http://www.freetype.org/)
* <code>OpenGL</code> Nothing to do... Framework is bundled with Xcode
* <code>OpenAL</code> Nothing to do... Framework is bundled with Xcode


NOTE: I installed those using MacPorts... but you can probably obtain "native" versions too.  
I installed those using MacPorts... but you can probably obtain "native" versions too.  
zLib: sudo port install zlib
* zLib: <code>sudo port install zlib</code>
freetype: sudo port install freetype
* freetype: <code>sudo port install freetype</code>
devil: sudo port install libdevil
* devil: <code>sudo port install libdevil</code>
boost: sudo port install boost
* boost: <code>sudo port install boost</code>
qt: sudo port install qt4-mac
* qt: <code>sudo port install qt4-mac</code>
sdl: sudo port install libsdl
* sdl: <code>sudo port install libsdl</code>
glew: sudo port install glew
* glew: <code>sudo port install glew</code>


Or as a single line:
Or as a single line:
sudo port install zlib freetype libdevil boost qt4-mac libsdl glew
sudo port install zlib freetype libdevil boost qt4-mac libsdl glew
 
== Cloning the code repository ==
=== Using GitHub for Mac ===
Refer to http://mac.github.com/help.html :)
 
=== From the command line ===
First, go to where you want the ArxLibertatis directory to be located.
cd ~/Code
 
You are now ready to clone the repository, type:
git clone git://github.com/arx/ArxLibertatis.git
 
This creates a directory called ArxLibertatis and downloads the current source code from github.
cd ArxLibertatis
 
== Compiling ==


*If you wish to use Xcode*
=== Building CMake from source ===
The latest release of CMake still has issues with Xcode 4.3, but it's been fixed in the development branch. You can build cmake from source to fix this:
The latest release of CMake still has issues with Xcode 4.3, but it's been fixed in the development branch. You can build cmake from source to fix this:
git clone http://cmake.org/cmake.git
git clone http://cmake.org/cmake.git
cd cmake
cd cmake
./configure
./configure
make
make
sudo make install
sudo make install
 
You're now ready to generate makefiles or an Xcode project. cd to the root of the arx repository


..
=== Makefiles ===
mkdir build
cd build
cmake ..
make


cmake .. -G Xcode
=== Xcode project ===
open ArxLibertatis.xcodeproj/
mkdir build_xcode
cd build_xcode
cmake .. -G Xcode
open ArxLibertatis.xcodeproj/

Revision as of 01:38, 3 April 2012

This page documents how to compile Arx Libertatis from https://github.com/arx/ArxLibertatis under Mac OS X.

Specific instructions are given for a cleanly installed Lion 10.7.3 system, but the procedure should be similar for other versions.

Setting Up the Build Environment

To download and compile Arx Libertatis you will need the following tools:

Libraries

I installed those using MacPorts... but you can probably obtain "native" versions too.

  • zLib: sudo port install zlib
  • freetype: sudo port install freetype
  • devil: sudo port install libdevil
  • boost: sudo port install boost
  • qt: sudo port install qt4-mac
  • sdl: sudo port install libsdl
  • glew: sudo port install glew

Or as a single line:

sudo port install zlib freetype libdevil boost qt4-mac libsdl glew

Cloning the code repository

Using GitHub for Mac

Refer to http://mac.github.com/help.html :)

From the command line

First, go to where you want the ArxLibertatis directory to be located.

cd ~/Code

You are now ready to clone the repository, type:

git clone git://github.com/arx/ArxLibertatis.git

This creates a directory called ArxLibertatis and downloads the current source code from github.

cd ArxLibertatis

Compiling

Building CMake from source

The latest release of CMake still has issues with Xcode 4.3, but it's been fixed in the development branch. You can build cmake from source to fix this:

git clone http://cmake.org/cmake.git
cd cmake
./configure
make
sudo make install

You're now ready to generate makefiles or an Xcode project. cd to the root of the arx repository

Makefiles

mkdir build
cd build
cmake ..
make

Xcode project

mkdir build_xcode
cd build_xcode
cmake .. -G Xcode
open ArxLibertatis.xcodeproj/