Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
Build and install gf

In this document, you will learn how to build and install gf so that you are ready for your first project with gf. It is assumed you already have a compiler installed (gcc or clang for Linux; MSVC included in Visual Studio for Windows).

gf needs a conformant C++17 compiler. The minimum version of supported compilers are given in the following table.

Compiler Version Reference
GCC 8 C++17 Support in GCC
Clang 5 C++17 implementation status
MSVC VS 2017 Visual C++ Language Conformance

Dependencies

gf needs some external libraries and tools that you must install before compiling gf. Here are some information about these libraries, especially the required minimum version.

Libraries:

Name Version License
SDL2 2.0.8 zlib/libpng
Boost String Algorithms 1.65 Boost
Boost Heap 1.65 Boost
Freetype 2.9.1 Freetype
zlib 1.2.11 zlib/libpng
pugixml 1.8.1 MIT

Tools:

Name Version
CMake 3.10.2

Getting started with Linux

This section assumes you have a working compiler, either gcc or clang, and git.

Dependencies for Linux

The recommanded way for handling dependencies on Linux is to use your favorite distribution's package manager. Here are the packages needed to build gf for various widespread distributions.

For Debian/Ubuntu:

apt-get install libsdl2-dev libboost-dev libfreetype6-dev zlib1g-dev libpugixml-dev cmake

For Archlinux:

pacman -S sdl2 boost freetype2 zlib pugixml cmake

For Fedora/Red Hat/CentOS:

dnf install SDL2-devel boost-devel freetype-devel zlib-devel pugixml cmake

Build and install

First, build:

git clone https://github.com/GamedevFramework/gf.git
cd gf
git submodule update --init
mkdir build
cd build
cmake ../ -DGF_BUILD_GAMES=ON -DGF_BUILD_TOOLS=ON
make

Then install:

make install # may require root permissions

Getting started with Windows

This section assumes you are using at least Visual Studio Community 2017. You also need git for Windows and vcpkg. Finally, the working directory where everything will be installed is set to C:\Local\. You can choose whatever directory you want.

First, you have to install vcpkg from its git repository. From a command line, in the working directory:

C:\Local> git clone https://github.com/Microsoft/vcpkg.git
C:\Local> cd vcpkg

Then, you have to follow the instructions from the vcpkg documentation. Normally, during the installation process, it will install CMake.

C:\Local\vcpkg> .\bootstrap-vcpkg.bat
C:\Local\vcpkg> .\vcpkg integrate install

Then, you can install the gf package:

C:\Local\vcpkg> .\vcpkg install gamedev-framework:x64-windows