Building Magic Smoke

Supported Platforms

Linux is supported for both client and server. It is originally developed on Debian and Ubuntu, but should work out of the box on any other distribution that provides the necessary tools and is recent enough. Tests are designed for this platform only.

Windows is only supported for building the client. While I'm convinced that the server would be able to work on Windows, there is no automatic support for it and I never tested it - you're on your own here.

MacOS/X might work for building the client if you have an absolutely cutting edge brand new Mac with the newest Xcode on it. I do not support it directly, since Apple does not support my barely 3-year-old Mac any more.

Other Unixoid systems are untested, but should work just like Linux if you install the proper tools.

Prerequisites

You need the Qt Framework Open Source edition version 5.0 or any newer. Qt is also needed to generate some code that the server relies upon - even though the server itself is written in PHP and does not need Qt at runtime.

You also need OpenSSL installed and Qt needs to be built with SSL-support. While the pure web-UI can run without SSL, it is highly recommended that you enable SSL for the complete server for security reasons. The client insists on using SSL - it is not possible to connect the client to the server without it.

You need a C++ compiler that works with Qt and supports at least some features of C++11. I usually recommend the latest stable GCC (as of early 2013 that is 4.7, soon 4.8) for Linux and other Unixoid systems and using the newest stable version of MinGW for Windows.

To make this point absolutely clear: I will not accept patches and ports that remove C++11 features, but I will accept patches that replace older constructs by cleaner ones that rely on C++11. My target compiler is the current stable version GCC. I do not test with LLVM, MSVC or any other compiler - so if your favorite compiler lacks C++11 features that GCC already implements: please let your compiler vendor know that you are disappointed. If I happen to use a feature that is not in the C++11 standard, let me know - I'll fix those.

The source documentation needs Doxygen in order to be built.

Starting from GIT

There are several components in MagicSmoke that rely on version information being available. So you have to create a clone of the main GIT repository first:
git clone git://silmor.de/konrad/smoke.git magicsmoke
cd magicsmoke
You may want to check out a specific tag. Please consult your git manual on how to do this.

Next you have to initialize your local copy, usually it is enough to run:

git submodule init
git submodule update
The setup assumes that the needed submodules are in repositories with URLs relative to MagicSmoke itself, like it is the case with the main repository listed above. If this does not work you have to clone all submodules manually.

Building

Both server and client depend on some shared code that is pre-compiled into some of their components. So it is easiest to do a complete build (unless you are familiar with the sources).

Make sure that the correct version of QMake is in your PATH (you can check this by executing qmake -version). Also note that MagicSmoke and Qt have to be compiled with the same compiler.

Go to the main directory of MagicSmoke. There are a few lines at the start of the Makefile that you can adjust to better match your system (defaults should be fine for most cases).

There is no support for automatic builds without MinGW on Windows. I have only tested Linux, MacOS/X and Windows/MinGW, so there is no guarantee for any other system.

Unixoid systems:
make rule

MacOS/X:
make macosx

Windows with MinGW:
mingw32-make rule

If you omit the rule parameter make will tell you which rules exist.

For the install targets the makefile assumes per default that everything belongs into sub-directories of /usr/local. You can change this by adding a PREFIX variable to the call, like this:
make -f Makefile PREFIX=$HOME/magicsmoke install
this will instead install into the magicsmoke subdirectory of the calling users home directory.

This part of the installation will place the client into its final place, and prepare the server scripts for actual installation (see below).

Optionally you can run unit-tests, see the tests page for details.

Manual Installation on Linux and Unix Systems

Install the Qt4 library so that it is usable by Qt-based programs on your system. For systems that use the ELF binary format (eg. any Linux) Qt itself will take care of storing its location in the binary (RPATH). On other systems you can solve the problem by setting LD_LIBRARY_PATH or SHLIB_PATH to Qt's lib path.

Make sure OpenSSL is installed and available to Qt. For the scripting interface of MagicSmoke it is also recommended to install the QtScript bindings.

Copy the src/msmoke binary to the location you want to start it from. Or call:
make -f Makefile PREFIX=/usr/local install-client
The latter will per default install into /usr/local/bin, you can change the target by setting a different PREFIX.

Packages for MacOS/X

Just build the entire package with:
make macosx

The src subdirectory will contain msmoke.app which can be started from the finder and msmoke.dmg which can be distributed on CD or via Web.

Manual Installation on Windows

Copy the src/msmoke.exe binary to a path you want to start it from. Then copy the Qt DLLs to the same path. From the OpenSSL directory copy libssl32.dll and libeay32.dll to that path. You should be able to start MagicSmoke from this path on any Windows machine.

If you used the full SDK of Qt to compile MagicSmoke, be sure to use the DLLs from the qt/bin subdirectory of the SDK, not the ones from bin - those are incompatible.

It is recommended to copy the contents of the plugins directory from your Qt installation to that path as well - this will make sure that all image formats etc. are supported.

For the scripting interface of MagicSmoke it is also recommended to install the QtScript bindings - they need to be placed in plugins/script.

Installation Package for Windows

This requires the NSIS Installer.

The nsis target of the Makefile will create an installation package:
make -f Makefile nsis

Building and Installing Packages on Debian and Ubuntu

You need a working Debian packaging environment, usually this amounts to:
sh$ apt-get install fakeroot debhelper

Additionally MagicSmoke needs some pre-requisites to build:
sh$ apt-get install libqt4-dev qt4-dev-tools subversion subversion-tools
These are the packages listed in debian/control as Build-Depends.

Then simply build the packages:
fakeroot debian/rules binary
or:
make dpkg

You should then have three packages:

You can install those packages with:
dpkg -i packagefile.deb

See the Server Installation page on how to install a server instance afte installing the package.