Skip to content
Jannik Vogel edited this page Dec 9, 2017 · 30 revisions

This article is WIP: nothing of this works, images are poorly hotlinked

It is assumed you have a working environment including C compiler which will work with CMake. It is also assumed that you have a working git installation and know how to use it.

For all platforms, you must first clone the repository:

git clone https://github.com/OpenSWE1R/openswe1r.git
cd openswe1r

Supported platforms:

Windows (Visual Studio 2017) Windows

Only compilation for x86 and x64 are officially supported.

Platform requirements

Make sure you have installed a full version of Visual Studio 2017. The Community Edition is available for free, but will require a free registration at Microsoft after a short period of time. Additionally, you need Microsofts vcpkg, a package manager for Windows. Please follow the vcpkg quick-start guide on its repository if you don't have it installed already. Optionally, you can also install an external installation of CMake.

Install dependencies

You also need to install unicorn which currently isn't provided by vcpkg. As a result, you need to manually download the port files:

FIXME!!

mkdir C:\tools\vcpkg\ports\unicorn\
Start-FileDownload 'https://raw.githubusercontent.com/JayFoxRox/vcpkg/unicorn-port/ports/unicorn/CONTROL' -FileName C:\tools\vcpkg\ports\unicorn\CONTROL
Start-FileDownload 'https://raw.githubusercontent.com/JayFoxRox/vcpkg/unicorn-port/ports/unicorn/portfile.cmake' -FileName C:\tools\vcpkg\ports\unicorn\portfile.cmake

x86:

vcpkg install sdl2:x86-windows unicorn:x86-windows glew:x86-windows openal-soft:x86-windows enet:x86-windows

x64:

vcpkg install sdl2:x64-windows unicorn:x64-windows glew:x64-windows openal-soft:x64-windows enet:x64-windows

Option 1: Using Visual Studio CMake support

Generate build files

In order to generate build files, you'll first have to create a settings file for CMake.

FIXME

Building

FIXME

Option 2: Using external CMake

Generate build files

x86:

cmake -G "Visual Studio 15 2017" -DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake ..

x64:

`cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake ..`

Building

msbuild msvc_build/openswe1r.sln

Windows (MSYS2 / MinGW) Windows

Only compilation for x86 and x64 are officially supported.

Platform requirements

Make sure you have MSYS2 installed as explained on the official website. Please make sure to also update your installation using pacman after going through the graphical setup. This is also explained on the website, but often ignored by users.

Install dependencies

x86:

mkdir unicorn
cd unicorn
wget https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-unicorn/PKGBUILD
MINGW_INSTALLS=mingw32 makepkg-mingw -sLf -i
cd ..
pacman -S mingw-w64-i686-SDL2 mingw-w64-i686-glew mingw-w64-i686-openal mingw-w64-i686-enet

x64:

mkdir unicorn
cd unicorn
wget https://raw.githubusercontent.com/Alexpux/MINGW-packages/master/mingw-w64-unicorn/PKGBUILD
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf -i
cd ..
pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-glew mingw-w64-x86_64-openal mingw-w64-x86_64-enet

Generate build files

cmake -G 'MSYS Makefiles' ..

Building

mingw32-make

macOS MacOS

Install dependencies

brew install cmake

Native:

brew install sdl2 unicorn glew openal-soft enet

Generate build files

cmake ..

Building

make

Ubuntu Ubuntu

Install dependencies

apt-get install cmake

Native:

apt-get install libopenal-dev libenet-dev libglew-dev libsdl2-dev

Generate build files

mkdir unicorn
cd unicorn
wget https://codeload.github.com/unicorn-engine/unicorn/tar.gz/1.0.1
tar xf unicorn-1.0.1.tar.gz --strip-components=1
./make.sh
cd ..
UNICORNDIR="`pwd`/unicorn" cmake ..

Building

make

Arch Linux Arch Linux

Install dependencies

pacman -S cmake

Native:

pacman -S community/unicorn extra/sdl2 extra/glew extra/openal community/enet

Generate build files

cmake ..

Building

make

Not officially supported:

Fedora Fedora

Debian Debian

Gentoo Gentoo

FreeBSD FreeBSD

OpenBSD OpenBSD

NetBSD NetBSD

Raspbian Raspbian

Android Android