Skip to content
Stefan Schindler edited this page Apr 5, 2017 · 1 revision

SFGUI is not available as a precompiled library anymore (starting from version 0.2.0). That means you have to build SFGUI yourself. No worries, this is usually an easy task, and even little-C++-experienced developers can do it.

Prerequisites

Install a C++11-compatible compiler! We have successfully tested GCC 4.8+ and Visual C++ 2013 (12.0). The Code::Blocks 12.11 release contains GCC 4.7.1 which is not compatible with SFGUI. You can simply upgrade your MinGW installation however and still use Code::Blocks.

Download and install CMake (version 2.8 or newer). If you're new to CMake, you might want to install CMake GUI too (default for Windows installations).

Continue by downloading and installing SFML. In case you are using a Linux operating system, you may want to use your package manager for installing the dependencies.

Download SFGUI by using one of the following options:

  • Stable: Download the source release
  • Bleeding edge: git clone https://github.com/TankOs/SFGUI.git

Running CMake

At first create a new build directory somewhere on your disk. Now run CMake and set the path of the build directory to the created directory and the root path to SFGUI's root directory. For Visual Studio on Windows make sure to run CMake in the Visual Studio developer console.

Click Configure and choose your desired generator. Depending on your operating system, we suggest these:

  • Linux: Unix makefiles
  • Windows/Visual Studio: nmake makefiles
  • Windows/MinGW: MinGW makefiles

It fails to find SFML or FindSFML.cmake!

  • Set SFML_ROOT to the SFML root directory.
  • Configure and generate again to apply the changes.

Some variables either have to be created by you or are only visible when you check the Advanced checkbox in CMake.

Build options

SFGUI automatically chooses good default values, however you can of course adjust the options (some need to be created).

  • SFGUI_BUILD_SHARED_LIBS: Build shared libraries.
  • SFGUI_BUILD_EXAMPLES: Build examples.
  • SFGUI_INCLUDE_FONT: Link the Deja Vu Sans font as a default/fallback font into the library.
  • SFGUI_BUILD_DOC: Generate Doxygen API reference (requires Doxygen to be installed).
  • SFGUI_USE_STATIC_STD_LIBS: Link to static standard libraries.
  • SFML_STATIC_LIBRARIES: Link to static SFML libraries.

When you're done with the options, click Configure again, then Generate.

Building

If you chose one of the generators we've suggested before, here are some short instructions:

  • Linux: Open a shell, cd into your build directory and type make install as root.
  • Windows/Visual Studio: Open the start menu, browse to Visual Studio 2013, Tools, and run the developer console with admin rights. Now cd into your build directory and type nmake install.
  • Windows/MinGW: Start cmd.exe with admin rights, cd into your build directory and type mingw32-make install (add MinGW's bin directory to your PATH environment variable before or prefix the mingw32-make command with the full path of where you've installed MinGW).

On Linux the library is installed to /usr/local/lib and support files & examples to /usr/local/share/SFGUI. On Windows the files are installed to C:\Program Files (x86)\SFGUI.

Clone this wiki locally