Build & install instructions
============================

These are build & install instructions for Dust Racing 2D.

Build dependencies
------------------

Dustrac currently uses CMake as the build system.

Currently the build depends only on Qt (>= 4.7).

Dustrac also exploits some features of the new C++11
standard, so a compliant compiler is required (GCC >= 4.6).

Building in the command line on Linux (tested on Ubuntu 12.04)
--------------------------------------------------------------

Development build (the game can be run without installing anything):

1) Install Qt development files (libqt4-dev on Ubuntu 12.04).
2) Install CMake.
3) Go to the source directory and run:

$ ./configure

This runs CMake that generates the makefiles.
You can also run cmake directly. The configure script
is only for convenience.

If everything went ok, run:
  
$ make

This will build the editor and the game binaries.

Run the game:

$ ./dustrac-game

Run the editor:

$ ./dustrac-editor

Release build (in this example game installs under /usr):

$ ./configure -DReleaseBuild=1 -DCMAKE_INSTALL_PREFIX=/usr

This runs CMake that generates the makefiles.
If everything went ok, run:

$ make

This will build the editor and the game binaries.

Install the binaries and data files:

$ sudo make install

This install also the desktop files so Dust Racing
should appear in your application menu.

Run the game:

$ dustrac-game

Run the editor:

$ dustrac-editor

Building by using QtCreator on Windows (tested on Windows 7)
------------------------------------------------------------

1) Download and install CMake.
2) Download and install QtCreator + Qt SDK.
3) Download the newest MinGW (GNU compiler tools for Windows).
   Replace the MinGW that came with QtCreator with the one you
   downloaded. No need to do this, if the version of g++ in Qt SDK
   is already >= 4.6.
4) Make sure that the path to Qt binaries are in your PATH
   (You should be able to run qmake from the command prompt without
   the absolute path).
5) Start QtCreator and open the top-level CMakeLists.txt from the
   Dust Racing source directory.
6) Run CMake and build.

Building by using QtCreator on Linux (tested on Ubuntu 12.04) 
-------------------------------------------------------------

1) Install QtCreator and CMake from the package repository.
2) Start QtCreator and open the top-level CMakeLists.txt from the
   Dust Racing source directory.
3) Run CMake and build.

For packagers
-------------

The binaries only need to find the data dir that includes
all the runtime data. This can be set in the main CMakeLists.txt
and is given to the game via -DDATA_PATH.

The release build should be used when packaging (give
-DReleaseBuild=1 to cmake).

Currently the data files install to CMAKE_INSTALL_PREFIX/share/DustRacing
and the binaries install to CMAKE_INSTALL_PREFIX/bin.

CMAKE_INSTALL_PREFIX usually defaults to /usr/local and
can be changed by giving, for example, -DCMAKE_INSTALL_PREFIX=/usr
to cmake (or to the configure script).

-- Jussi Lind <jussi.lind@iki.fi>
