This tutorial aims to simplify the compilation of TrinityCore on Mac OS X by using Homebrew, the missing package manager for OS X, to install TrinityCore dependencies, in order to keep things simple.
[SIZE=18px]1) Install Homebrew[/SIZE]
For those who don’t have Homebrew installed, you can easily install it typing:
ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
[SIZE=18px]2) Install Xcode and Command Line Tools[/SIZE]
Install XCode using the App Store, then type:
xcodeselect --install
[SIZE=18px]3) Install dependencies[/SIZE]
brew update
brew install mysql openssl readline cmake boost zlib
brew link zlib --force
[SIZE=18px]4) Getting sources[/SIZE]
Move to the folder where you want to place the TrinityCore sources, then type:
git clone https://github.com/TrinityCore/TrinityCore.git
cd TrinityCore
If ( and [B]ONLY[/B] if ) you want to compile 3.3.5 type:
git checkout 3.3.5
Create build folder:
mkdir build
cd build
[SIZE=18px]5) Generate the XCode project files[/SIZE]
IMPORTANT: replace /Users/username/tc-server of the following command with the path where you want to install the TrinityCore server.
then type:
cmake …/ -GXcode
-DMYSQL_ADD_INCLUDE_PATH=/usr/local/include
-DMYSQL_LIBRARY=/usr/local/mysql/lib/libmysqlclient_r.dylib
-DREADLINE_INCLUDE_DIR=/usr/local/opt/readline/include
-DREADLINE_LIBRARY=/usr/local/opt/readline/lib/libreadline.dylib
-DBOOST_INCLUDEDIR=/usr/local/include
-DBOOST_LIBRARYDIR=/usr/local/lib
-DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include
-DOPENSSL_SSL_LIBRARIES=/usr/local/opt/openssl/lib/libssl.dylib
-DOPENSSL_CRYPTO_LIBRARIES=/usr/local/opt/openssl/lib/libcrypto.dylib
-DZMQ_LIBRARY=/usr/local/opt/zeromq/lib/libzmq.dylib
-DZMQ_INCLUDE_DIR=/usr/local/opt/zeromq/include
-DZLIB_ROOT=/usr/local/Cellar/zlib/1.2.8
-DCMAKE_INSTALL_PREFIX=/Users/username/tc-server
-DWITH_WARNINGS=1
[SIZE=18px]6) Building the binaries[/SIZE]
Type the following to build the binaries:
xcodebuild -target install -config Release
I have tested this tutorial both for branch [B]3.3.5[/B] and [B]6.x[/B] using a [B]MacBook Pro Retina 15"[/B] running:
-
a fresh Mac OS X 10.9.5 (Mavericks)
-
a fresh Mac OS X 10.10.3 (Yosemite)
-
Mac OS X 10.11.3 (El Capitan)
and it worked fine, give me your feedback.