Skip to content

Latest commit

 

History

History
177 lines (108 loc) · 4.97 KB

Build.md

File metadata and controls

177 lines (108 loc) · 4.97 KB

Building TrenchBroom

Follow these instructions if you want to get started developing on TrenchBroom.

To see how releases of TrenchBroom are packaged, consult our CI scripts instead.

All Platforms

First, clone the TrenchBroom repository. --recursive is needed because we use git submodules:

git clone --recursive https://github.com/TrenchBroom/TrenchBroom.git

If you have an existing git clone, you can update submodules using:

git submodule update --init --recursive

Dependencies

TrenchBroom uses vcpkg to manage build dependencies except for Qt. vcpkg is integrated into TrenchBroom's build system and will download and build all dependencies once during cmake's configure phase. This is an automatic process, but it can take a little while when it happens for the first time.


Docker

An external unofficial project called Dockerized TrenchBroom is available for developers. It facilitates the compilation of TrenchBroom's source code and the creation of binaries using Docker.


Windows

Prerequisites

In order to develop, debug and compile TrenchBroom, you need to install tools listed below.

Visual Studio 2022

Download VS 2022 and install it.

You'll also need to install these dependencies using Visual Studio Installer (included with main installer):

  • Workloads
    • Desktop development with C++

Project dependencies

  • Download and install Qt for MSVC 2017 32-bit and/or 64-bit
    • Important: You have to create a personal account
    • Minimum required version is 5.12
  • Download and install latest version of CMake for Windows
  • Download and install latest version of pandoc

Project configuration with cmake

Create a subdirectory in TrenchBroom directory called build.

Open a command prompt and change directory to build:

cd <path/to/TrenchBroom>/build

Then, execute this command to configure the project:

  • For 32-bit:
cmake .. -G"Visual Studio 17 2022" -T v143 -A Win32 -DCMAKE_PREFIX_PATH="C:\Qt\5.13.0\msvc2017"
  • For 64-bit:
cmake .. -G"Visual Studio 17 2022" -T v143 -A x64 -DCMAKE_PREFIX_PATH="C:\Qt\5.13.0\msvc2017_64"

Note: Make sure to specify the correct Qt as CMAKE_PREFIX_PATH value.

Build and debug TrenchBroom

To build and debug TrenchBroom, press F5 key. After a success compilation process, TrenchBroom should automatically be opened in Debug mode.


Linux

Prerequisites

In order to develop, debug and compile TrenchBroom, you need to install tools listed below.

Project dependencies

TrenchBroom depends on:

If you have a debian-based distribution, open a command prompt and execute this command to install required dependencies:

sudo apt-get install g++ qtbase5-dev libqt5svg5-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev libglew-dev libxrandr-dev build-essential libglm-dev libxxf86vm-dev libfreetype6-dev libfreeimage-dev libtinyxml2-dev pandoc cmake p7zip-full ninja-build curl

Build TrenchBroom

Create a subdirectory in TrenchBroom directory called build.

Open a command prompt and change directory to build:

cd <path/to/TrenchBroom>/build

Then, execute this command to configure the project:

cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="cmake/packages"
cmake --build . --target TrenchBroom

Note: You can replace Debug with Release if you want to create a release build.


Mac OS X

Prerequisites

In order to develop, debug and compile TrenchBroom, you need to install tools listed below.

Xcode

Download Xcode from the App Store.

Project dependencies

Open a command prompt and execute this command to install required dependencies:

brew install cmake qt pandoc python pkg-config

Finally, build the project:

mkdir build-xcode
cd build-xcode
cmake .. -GXcode -DCMAKE_PREFIX_PATH="$(brew --prefix qt)"
open TrenchBroom.xcodeproj

Note: Don't enable Address Sanitizer in Xcode; it breaks rebuilding of the project (see #1373).


How to release

Open a new command prompt.

Generate a changelog:

git log --oneline --decorate <LAST_REL_TAG>..HEAD

Note: <LAST_REL_TAG> is replaced by whatever tag marks the last release. The generated log is then manually cleaned up.

Then, tag your changes:

git tag -a v2019.1 -m "This tag marks TrenchBroom 2019.1."

And finally, push the tagged release:

git push origin v2019.1