]> git.lizzy.rs Git - dragonblocks_alpha.git/blobdiff - BUILDING.md
Use spaces for alignment
[dragonblocks_alpha.git] / BUILDING.md
index c9425308a743209f44bcf8b4372bd8e118eb64f5..0b110cb9f64bd9a7cfa6f2bc349d8ef8c4462476 100644 (file)
@@ -1,42 +1,48 @@
 # Building instructions
 
-GNU make is used for compiling. The code and the Makefile are located in the src/ directory.
-
-## Dependencies
-To build anything you need g++ and GNU make. The ZLib development library is needed as well.
+CMake is used for compiling. Make sure to clone the repository recursively:
 
 ```bash
-sudo apt install build-essential make zlib1g-dev
+git clone --recurse-submodules https://github.com/dragonblocks/dragonblocks_alpha.git
 ```
 
-The development versions OpenGL, GLFW3, GLEW are required to build the client.
+## Dependencies
+To build anything you need CMake. The ZLib development library is needed as well.
+The development versions of OpenGL, GLFW3, GLEW and Freetype are required to build the client.
+For building the server the SQLite3 development library is required.
+
+
+Ubuntu / Debian:
 
 ```bash
-sudo apt install libgl1-mesa-dev libglfw3-dev libglew-dev
+sudo apt install build-essential cmake zlib1g-dev libgl1-mesa-dev libglfw3-dev libglew-dev libfreetype-dev libsqlite3-dev
 ```
 
-For building the server, the SQLite3 development library is required.
+FreeBSD:
 
-```bash
-sudo apt install libsqlite3-dev
+```csh
+sudo pkg install cmake gcc lzlib mesa-devel glfw glew freetype sqlite3
 ```
 
-Don't forget to pull the submodules before building.
+OpenBSD:
 
-``bash
-git submodule update --init
+```sh
+sudo pkg_add cmake lzlib glfw glew freetype sqlite3
 ```
 
-## Available targets
-- `all` (default)
-- `Dragonblocks`
-- `DragonblocksServer`
-- `clean`
-- `clobber`
+## Building a debug build
+By default CMake will make a Debug build if nothing else is specified. Simply use
+
+```bash
+cd src
+cmake .
+make -j$(nproc)
+```
 
-The debug flag (`-g`) is set by default (RELEASE=TRUE will disable it).
+to build the dragonblocks client and server.
+If you use a debug build, the singleplayer script should be invoked from the src/ directory, because that's where the binaries are located.
 
-## Release
+## Building a snapshot
 
 ```bash
 ./snapshot.sh