This guide explains how to build Summoning Wars from its source code, either release tarball or repository.
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:
- OGRE >= 1.7.0
- CEGUI >= 0.7.2, < 0.8
- OpenAL + freeALUT
- ogg, vorbis + vorbisfile
- 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:
- Stable (0.5.8 Release) or Testing (0.5.6 Release) release tarballs which you just have to Download and extract it to a folder called sumwars-code.
- The latest development source code from the source repository at BitBucket for which you have to clone the repository:
hg clone https://bitbucket.org/sumwars/sumwars-code hg update defaultThis will create the sumwars-code folder containing the latest sources and it might take a while.
Summoning Wars relies on the power of CMake for its configuration.
- 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.
- Run cmake-gui and select the Summoning Wars source folder (sumwars-code).
- 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.
- 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.
- The next step is to adjust the Summoning Wars options to your needs (look at the next section).
- 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.
Developers usually want to make changes and test them without installing the game after each change. This is allowed through enabling the following options:
- SUMWARS_STANDALONE_MODE will change all paths to be local and relative to the executable.
- SUMWARS_POST_BUILD_COPY will copy the Summoning Wars binary back to sumwars-code so that resource paths match.
- (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.
- Open the build directory of your choice (default is sumwars-code/build).
- 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
|This sections needs major cleaning and clarification.|
(work in progress)
- Download and install a C++ IDE. Most of the current contributors that are developing on Windows use Microsoft Visual Studio 2010 Express Edition.
- Download and install an Hg client (Like Tortoise Hg)
- Download and install CMake
- Clone the Summoning Wars source code with either option:
- Hg command line:
hg clone https://bitbucket.org/sumwars/sumwars-code
- Hg command line:
- Tortoise Hg:
- Right click in Windows Explorer on the root folder for development (E.g. d:\coding\), and select Hg clone...
- Enter https://bitbucket.org/sumwars/sumwars-code/src as the source-url of the repository, and sumwars as the checkout directory
- 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.
Precise Pangoline (12.04) and newer
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 sudo apt-get install libtinyxml-dev
Make sure you enable SUMWARS_NO_TINYXML in cmake-gui! Otherwise you will get a weird segfault because of a conflict between CEGUI tinyxml parser and bundled sumwars tinyxml.
After the first start of the game (which will fail, telling you it can't find RenderSystem_GL), edit your ~/.sumwars/plugins.cfg or ./.sumwars/plugins.cfg (depending on portable mode) and set the PluginFolder to /usr/lib/i386-linux-gnu/OGRE-1.7.4 (the i386-linux-gnu middle is different on non-32bit archs, use your wits to find it if you are not on 32bit!)
Older than Precise Pangoline (12.04)
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
package "sumwars" is available on Fedora 16+ - unless you want to develop sumwars that's probably the best way to get it
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, physfs-devel. Just copy pasting this after "sudo yum install " should install all of them.
The build process is straightforward on Fedora, just follow the general instructions for Linux systems.
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 wget http://aur.archlinux.org/packages/ce/cegui-ogre/PKGBUILD makepkg -s sudo pacman -U cegui-ogre cd .. mkdir poco && cd poco wget http://aur.archlinux.org/packages/po/poco/PKGBUILD 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.