Difference between revisions of "How to build VCMI (macOS)"

From VCMI Project Wiki
Jump to: navigation, search
(Prerequisites)
(updating build for OSX)
Line 3: Line 3:
 
* CMake. Can be downloaded from ([http://www.cmake.org/cmake/resources/software.html link]) or installed from Homebrew/MacPorts
 
* CMake. Can be downloaded from ([http://www.cmake.org/cmake/resources/software.html link]) or installed from Homebrew/MacPorts
  
== Preparing place ==
+
Installing XCode
Open terminal and go to directory where you want to place vcmi and run:
+
----------------
 +
App Store -> XCode
 +
Launch it after the installation to agree with it's license terms.
 +
 
 +
Installing Homebrew
 +
-------------------
 
<pre>
 
<pre>
mkdir vcmi && cd vcmi
+
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
git clone https://github.com/vcmi/vcmi.git
+
</pre>
 +
 
 +
Installing dependencies available in Homebrew
 +
---------------------------------------------
 +
<pre>
 +
brew install git smpeg2 innoextract cmake libpng freetype sdl2 sdl2_ttf sdl2_image
 +
brew install sdl2_mixer --with-smpeg2
 +
</pre>
 +
 
 +
Installing Sparkle
 +
------------------
 +
<pre>
 +
wget https://github.com/sparkle-project/Sparkle/releases/download/1.11.0/Sparkle-1.11.0.tar.bz2
 +
mkdir sparkle && cd sparkle
 +
tar -xf ../Sparkle-1.11.0.tar.bz2
 +
sudo mv Sparkle.framework /Library/Frameworks/
 +
cd .. && rm -rf sparkle
 +
</pre>
 +
 
 +
Getting and configuring VCMI
 +
----------------------------
 +
<pre>
 +
git clone -b develop --depth 1 https://github.com/vcmi/vcmi.git
 
cd vcmi
 
cd vcmi
sh osx/download_dependencies.sh
 
 
mkdir build && cd build
 
mkdir build && cd build
cmake -G Xcode .. -DENABLE_LAUNCHER=OFF
+
cmake -G "Unix Makefiles" .. -DENABLE_LAUNCHER=OFF -DCMAKE_BUILD_TYPE=Release -Wno-devc
open vcmi.xcodeproj
+
cd ..
 +
</pre>
 +
 
 +
Building OSX-specific stuff
 +
---------------------------
 +
<pre>
 +
xcodebuild -project osx/osx-vcmibuilder/vcmibuilder.xcodeproj/ -configuration Release
 +
mv osx/osx-vcmibuilder/build/Release/vcmibuilder.app osx/vcmibuilder.app
 +
</pre>
 +
 
 +
Building VCMI
 +
-------------
 +
<pre>
 +
cd build
 +
make -j4
 +
cd ..
 +
</pre>
 +
 
 +
Running VCMI
 +
------------
 +
Go to bin and launch vcmiclient; alternatively
 +
<pre>
 +
bin/vcmiclient.app/Contents/MacOS/vcmiclient
 
</pre>
 
</pre>
  
 
== Building ==
 
== Building ==
 
* Select vcmiclient in list of targets and press Run (Command + R)
 
* Select vcmiclient in list of targets and press Run (Command + R)

Revision as of 13:06, 13 December 2015

Prerequisites

  • Xcode. Can be downloaded from Mac App Store.
  • CMake. Can be downloaded from (link) or installed from Homebrew/MacPorts

Installing XCode


App Store -> XCode Launch it after the installation to agree with it's license terms.

Installing Homebrew


ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Installing dependencies available in Homebrew


brew install git smpeg2 innoextract cmake libpng freetype sdl2 sdl2_ttf sdl2_image
brew install sdl2_mixer --with-smpeg2 

Installing Sparkle


wget https://github.com/sparkle-project/Sparkle/releases/download/1.11.0/Sparkle-1.11.0.tar.bz2
mkdir sparkle && cd sparkle
tar -xf ../Sparkle-1.11.0.tar.bz2
sudo mv Sparkle.framework /Library/Frameworks/
cd .. && rm -rf sparkle

Getting and configuring VCMI


git clone -b develop --depth 1 https://github.com/vcmi/vcmi.git
cd vcmi
mkdir build && cd build
cmake -G "Unix Makefiles" .. -DENABLE_LAUNCHER=OFF -DCMAKE_BUILD_TYPE=Release -Wno-devc
cd ..

Building OSX-specific stuff


xcodebuild -project osx/osx-vcmibuilder/vcmibuilder.xcodeproj/ -configuration Release
mv osx/osx-vcmibuilder/build/Release/vcmibuilder.app osx/vcmibuilder.app

Building VCMI


cd build
make -j4
cd ..

Running VCMI


Go to bin and launch vcmiclient; alternatively

bin/vcmiclient.app/Contents/MacOS/vcmiclient

Building

  • Select vcmiclient in list of targets and press Run (Command + R)