Build instructions

From Summoning Wars
Revision as of 18:46, 9 March 2012 by Protogenes (Talk | contribs)
Jump to: navigation, search

This guide explains how to build Summoning Wars from its source code, either release tarball or repository.


General instructions

Installing dependencies

For Summoning Wars to build you need the development versions of the libraries it is using.
If you are lucky all libraries may be installed via your favorite package manager (apt-get, yum, emerge, pacman, ...).
The following lists the dependencies and the required version:

  1. OGRE >= 1.7.0
  2. OIS
  3. CEGUI >= 0.7.2, < 0.8
  4. OpenAL + freeALUT
  5. Lua5.1
  6. ogg, vorbis + vorbisfile
  7. PhysFS
  8. PoCo (for debug build only)

Get the source code

After all dependencies installed successfully you have to choose your Summoning Wars source code download. There are basically two options:

  1. Stable (0.5.6 Release) or Testing (0.5.6 Release) release tarballs which you just have to Download and extract it to a folder called sumwars-code.
  2. The latest development source code from the source repository at BitBucket for which you have to clone the repository:
    hg clone
    hg update default
    This will create the sumwars-code folder containing the latest sources and it might take a while.


Summoning Wars configuration

Summoning Wars relies on the power of CMake for its configuration.

  1. There are various options to invoke the CMake configuration process:
    • cmake will need all options to be present on the command line
    • cmake -i will launch an interactive command line configuration
    • cmake-gui will start a graphical configuration, which is the favored way.
  2. Run cmake-gui and select the Summoning Wars source folder (sumwars-code).
  3. Additionally you should select a build directory where CMake generates its output. The default for this guide will be a folder called build within sumwars-code.
  4. Hit Configure and CMake will look for the dependencies and you should get a result similar to the screenshot. Pay close attention to any output and make sure no errors occurred before you continue.
  5. The next step is to adjust the Summoning Wars options to your needs (look at the next section).
  6. The last step is to run another Configure followed by Generate. Once that successfully finished the files to build Summoning Wars should have been generated in the build folder and you are free to close cmake-gui.

Developer configuration

Developers usually want to make changes and test them without installing the game after each change. This is allowed through enabling the following options:

  1. SUMWARS_STANDALONE_MODE will change all paths to be local and relative to the executable.
  2. SUMWARS_POST_BUILD_COPY will copy the Summoning Wars binary back to sumwars-code so that resource paths match.
  3. (optional) SUMWARS_PORTABLE_MODE will prevent the developer version from messing with the save files in your home/user directory and instead use a local path.

User configuration on UNIX/Linux systems

For installing the game in the correct location you might want to change CMAKE_INSTALL_PREFIX to match your filesystem layout. The default for the most systems will be /usr.

User configuration on Windows systems

Windows users need to enable SUMWARS_STANDALONE_MODE because windows doesn't have a global directory where resources are found. Instead the resources are installed in the program folder as well.


  1. Open the build directory of your choice (default is sumwars-code/build).
  2. Invoking the build depends on the generator you selected in cmake-gui:
    just run make -j NUMBER_OF_YOUR_PROCESSORS.
    Visual Studio project file
    Open the solution file and hit Build.


If you configured your Summoning Wars to be installed on a UNIX/Linux system (you didn't choose the developer options and checked for a correct CMAKE_INSTALL_PREFIX) you will have to run make install as root. After that you can run Summoning Wars by running sumwars.
For the developer configuration you just run ./sumwars within the sumwars-code directoy to start the game.
On Windows systems you might need to copy the resulting binary file into sumwars-code to play the game.

System specific hints


(work in progress)

  1. Download and install a C++ IDE. Most of the current contributors that are developing on Windows use Microsoft Visual Studio 2010 Express Edition.
  2. Download and install an Hg client (Like Tortoise Hg)
  3. Download and install CMake
  4. Clone the Summoning Wars source code with either option:
    • Hg command line:
      hg clone
hg update default
    • Tortoise Hg:
    1. Right click in Windows Explorer on the root folder for development (E.g. d:\coding\), and select Hg clone...
    2. Enter as the source-url of the repository, and sumwars as the checkout directory
  1. Obtain the following libraries (it's recommended to download/install them in sub-directories of a root directory. E.g. c:\dev\OGRE, c:\dev\CEGUI, etc): You may obtain the dependency package from here. That's the easy solution: just copy the dependencies to the Dependencies subfolder in the sumwars local repository. If the download is no longer available, you will need to download all items manually, as described below. If the download is available, you will only need to define the environment variables described below.
    • OGRE 3D >= 1.7.0 ; it's recommended that you download the SDK
    • OIS (included with OGRE)
    • CEGUI >= 0.7 . You can get the SDK, but it's recommended to clone the Mercurial repository. (If you build it from source, don't forget to download the dependencies as well)
      • You should also define an environment variable named CEGUIDIR to point to the CEGUI folder. If you use the Mercurial repository, you may need to copy the contents of %CEGUIDIR%/include into %CEGUIDIR%/include/cegui
    • GnuWin32 libIntl for Windows (you can get the installer)
      • If you do not install it to the default location, you must also define an environment variable named GNUWINDIR pointing to the folder where you installed GnuWin32 (E.g. c:\dev\GnuWin32)
    • Lua 5.1
      • You must also add an environment variable named LUA_DEV to point to the folder where lua5.1.lib and lua5.1.dll are located
    • PhysycsFS - you can get a tar.gz file, but it's recommended to clone the Mercurial repository.
      • You must also add an environment variable named PHYSFSDIR pointing to the folder where you installed physfs (E.g. c:\dev\physfs)
    • libogg & libvorbis (from Xiph)
      • You should define an environment variable named OGGDIR to point to the place where the libogg is installed (E.g. c:\dev\libogg)
      • You should define an environment variable named VORBISDIR to point to the place where the libvorbis is installed (E.g. c:\dev\libvorbis)
      • If you download the source packages, you need to build them. That should be pretty straightforward (there are IDE specific project files available, such as %OGGDIR%/win32/vs2010)
    • freealut - it's recommended that you download the binary version
      • You must also define an environment variable named ALUTDIR to point to the place where the freealut is installed (E.g. c:\dev\freealut-1.1.0-bin)
    • openal - it's recommended that you download the SDK
    • (Only for the scenarios where build tools activated) POCO Libraries
      • Build tools can be configured at the project generation with CMake.


Ogre 1.7.0 and CEGUI 0.7 are not included in the standard repositories yet. But you may get them from this additional repository.

To install all needed dependencies enter the following command into the terminal:

sudo apt-get install libogre-dev
sudo apt-get install libcegui-dev
sudo apt-get install libois-dev
sudo apt-get install libalut-dev
sudo apt-get install liblua5.1-0-dev
sudo apt-get install libopenal-dev
sudo apt-get install libvorbis-dev
sudo apt-get install libfreeimage-dev
sudo apt-get install libphysfs-dev
sudo apt-get install libxrandr-dev


Packages can be installed through yum install <name>. You need to use either su to start a super user session or use sudo yum install <name> for each package. The packages you might require are: mercurial, cmake-gui, gcc-c++, libstdc++-devel, ogre-devel, physfs-devel, poco-devel, cegui-devel, ois-devel, libvorbis-devel, freealut-devel, lua-devel, libXrandr-devel, ois-devel, lua-devel, cegui-devel, openal-devel, freealut-devel, libogg-devel, libvorbis-devel, poco-devel and physfs-devel.
The build process is straight forward on Fedora, just follow the general instructions for Linux systems.

Arch Linux

You'll need to build cegui-ogre and poco yourself and there are also lot's of handy tools you could use.
It's not really an official way to install it but it works, and allows to remove the packages with pacman.
A big thank you to the AUR repository contributors.
I enabled ABS just in case ABS.

cd ~
mkdir mybuilds && cd mybuilds
mkdir cegui-ogre && cd cegui-ogre
sudo pacman -S cmake enet freealut libvorbis ogre openal physfs subversion wget gdb
makepkg -s
sudo pacman -U cegui-ogre
cd ..
mkdir poco && cd poco
makepkg -s
sudo pacman -U poco
cd ..

Explanation: make a directory where you will work.
build cegui-ogre and poco from aur repositories.
Install available dependencies and tools you might need to build run the svn version.


Summoning Wars is in the sunrise overlay.
All you need to do is to install layman by following the Gentoo Overlays: Users' Guide.
For Summoning Wars you need to unmask some packages, please refer to the Gentoo Handbook: Mixing Software Branches for this and run emerge games-rpg/sumwars.

Personal tools