-
Notifications
You must be signed in to change notification settings - Fork 22
Building On OS X
If you want to compile Trillek on OS X, your system should be running OS X 10.9 Mavericks or later. You will need to have installed the Command Line Tools and a recent Xcode. Both can be downloaded from the Apple Developer Website.
Before you can build Trillek, you'll first need to install the dependencies separately. Using a package manager, such as MacPorts, is recommended.
If MacPorts is present, you can use the following commands to install CMake, GLM, GLFW3, libogg, libvorbis, and Lua:
sudo port install cmake
sudo port install glm
sudo port install glfw
sudo port install libogg
sudo port install libvorbis
sudo port install lua
The current Macports version of Bullet does not include all of the libraries Trillek depends on. You will need to compile Bullet manually.
svn checkout http://bullet.googlecode.com/svn/trunk/ bullet-read-only
cd bullet-read-only
cmake . -G "Unix Makefiles" -DCMAKE_OSX_ARCHITECTURES='i386;x86_64' -DBUILD_DEMOS=OFF -DUSE_DOUBLE_PRECISION=ON
make -j10 && sudo make install
ALURE is not available in MacPorts and must be downloaded from the ALURE website. Follow the instructions under the Source Install section.
RapidJSON is a header-only library avaiable here. Clone or download the repository and copy the contents of the include
directory into one of /usr/include
or /usr/local/include
.
The final library, LuaWrapper, is also a header-only library avaiable on bitbucket. Clone or download the repository and copy the contents into one of /usr/include/luawrapper
or /usr/local/include/luawrapper
, creating the luawrapper
directory as necessary.
Once all the dependencies are installed, you can build Trillek.
mkdir build/
cd build/
cmake ..
make Trillek_Client
Before running Trillek, you must create a symbolic link back to the common
submodule in the root directory. This allows Trillek to locate its assets at runtime. The symbolic link should be placed in build/bin
.
cd bin
ln -s ../../common ./
The binary(s) are written to build/bin
.
You must launch Trillek from a shell in the build/bin
directory. Launching Trillek using the Finder will not set the working directory correctly.
On OS X, CMake can generate an Xcode project for Trillek.
mkdir build/
cd build/
cmake .. -G Xcode
You must change the current scheme to Trillek_Client by clicking on the scheme popup menu and selecting Trillek_Client. The symbolic link to the common
submodule must be placed in build/bin/<CONFIGURATION>
where <CONFIGURATION>
is defined by the current build scheme.