forked from TrenchBroom/TrenchBroom
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBuild.txt
144 lines (127 loc) · 7.33 KB
/
Build.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
====== All Platforms ======
- We use pandoc (http://www.pandoc.org) to generate the documentation. Install a binary distribution from the website and make sure that it is in your PATH, otherwise your builds will fail.
====== Windows ======
- Generally, the cmake scripts don't handle paths with spaces very well, so make sure that you check out the TrenchBroom source repository somewhere on a path without any spaces.
- For Visual Studio (only tested with 2010)
- Get the binary build of wxWidgets 3 for your platform from
http://www.wxwidgets.org
- For 32bit builds, you need the following files:
If you are using a different version of Visual Studio, you will have to download other binaries, e.g., wxMSW-<version>-vc120_Dev.7z etc. and you will also have to use different directory names instead of vc100_dll below.
- wxWidgets-<version>_headers.7z
- wxMSW-<version>_vc100_Dev.7z
- wxMSW-<version>_vc100_ReleaseDLL.7z
- wxMSW-<version>_vc100_ReleasePDB.7z
- Unpack all files into c:\wxWidgets-<version> so that "include" and "lib" directories are at the same level after unpacking.
- The directory layout should look like this:
wxWidgets-3.0.0
\include
\msvc
\wx
\wx
<wxwidgets header files>
\lib
\vc100_dll
<wxwidgets libraries>
- Set a new environment variable WXWIN=C:\wxWidgets-<version> (replace the path with the path where you unpacked wxWidgets).
- If you want to run the binaries without using the installer, add %WXWIN%\lib\vc100_dll to your path. The relevant parts of my PATH variable look something like this:
C:\Program Files (x86)\CMake 2.8\bin;c:\wxWidgets-3.0.0\lib\vc100_dll;
- Download and install CMake for Windows (www.cmake.org)
- Open a command prompt and change into the directory where you unpacked the TrenchBroom sources.
- Create a new directory, e.g. "build", and change into it.
- Run the following two commands
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release --target TrenchBroom
You can replace "Release" with "Debug" if you want to create a debug build. This is also recommended if you want to work on the source in Visual Studio.
- For MinGW 64
- Download and install MinGW from http://mingw-w64.sourceforge.net/
- Scroll down to Mingw-builds and select the appropriate version for your OS (32 or 64 Bit), then select the SJLJ variant.
- Add <MinGW installation dir>/bin to your path.
- Download wxWidgets source (for DOS / Windows) from http://www.wxwidgets.org/
- Unpack the sources somewhere to C:\wxWidgets-3.0.0
- Build wxWidgets
- Open a command prompt and cd into C:\wxWidgets-3.0.0\build\msw
- Run these commands
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 OPENGL=1 BUILD=release clean
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 OPENGL=1 BUILD=release
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 OPENGL=1 BUILD=debug clean
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 OPENGL=1 BUILD=debug
- Set a new environment variable WXWIN=C:\wxWidgets-<version> (replace the path with the path where you unpacked wxWidgets).
- If you want to run the binaries without using the installer, add %WXWIN%\lib\gc_dll to your path. The relevant parts of my PATH variable look something like this:
C:\Program Files (x86)\CMake 2.8\bin;c:\wxWidgets-3.0.0\lib\gcc_dll;
====== Linux ======
Dependencies
Compiling wxWidgets 3 requires the following dependencies. You should install them using the packager of your Linux distribution.
- g++ GNU c++ compiler
- GTK2 and development packages: libgtk2.0-dev (GTK3 will NOT work)
- FreeImage: libfreeimage-dev
- OpenGL and GLU development headers (Mesa OpenGL development packages)
freeglut3, freeglut3-dev, mesa-common-dev
- X11 video mode extension library: libxxf86vm-dev
- If you have a debian-based distribution, install them with this command:
sudo apt-get install libgtk2.0-dev freeglut3 freeglut3-dev libglew-dev mesa-common-dev build-essential libglm-dev libxxf86vm-dev libfreeimage-dev pandoc wx3.0-headers libwxbase3.0-dev libwxgtk-media3.0-dev
Compiling and linking TrenchBroom requires a working OpenGL installation. This page may help you if you see linker errors about missing GL libraries:
http://www.wikihow.com/Install-Mesa-%28OpenGL%29-on-Linux-Mint
- Some more detailed (possibly outdated) information about building TrenchBroom on Linux: http://andyp123.blogspot.de/2013/03/running-trenchbroom-quake-editor-on.html
wxWidgets
- You have two options here: Either install wxWidgets 3 using your package manager of choice, or download and build it yourself. For the latter, you may follow these instructions:
- Get the latest sources of wxWidgets 3 from wxwidgets.org and unpack them.
- Move the unpacked directory someplace where you want to keep it.
- Open a terminal and change into the wxwidgets directory.
- Create two directories: build-release and build-debug (don't rename those!)
- Change into wxwidgets/build-release
- Run
../configure --disable-shared --with-opengl --with-gtk=2
- Run make
- Run sudo make install
- Change into wxwidgets/build-debug
- Run
../configure --enable-debug --with-opengl --with-gtk=2
- Run make
- Run sudo make install
CMake
- Install CMake using your package manager: sudo apt-get install cmake
Build TrenchBroom
- Open a terminal and change into the directory where you unpacked the TrenchBroom sources
- Create a new directory, e.g. "build", and change into it.
- Run the following two commands
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --target TrenchBroom
You can replace "Release" with "Debug" if you want to create a debug build.
Packaging
- If you want to create packages for Linux (deb or rpm), then you'll need to install these packages: devscripts, debhelper, rpm
sudo apt-get install devscripts debhelper rpm
Notes
- On some systems, such as Xubuntu, you may have to pass the following extra paramter to cmake when creating the build scripts: -DFREETYPE_INCLUDE_PATH=/usr/include/freetype2/freetype
So the first cmake command should be
cmake .. -DCMAKE_BUILD_TYPE=Release -DFREETYPE_INCLUDE_PATH=/usr/include/freetype2/freetype
====== Mac OS X ======
Build environment
1. Get Xcode from the App Store
2. Dependencies
- Install cmake (required) and ninja (optional). For example, with homebrew:
brew install cmake ninja
3. wxWidgets
- Get the latest sources of wxWidgets 3 from wxwidgets.org and unpack them.
- Move the unpacked directory someplace where you want to keep it.
- Open a terminal and change into the wxwidgets directory.
- Apply the patches in TrenchBroom/patches/wxWidgets
- Create two directories: build-release and build-debug (don't rename those!)
- Change into wxwidgets/build-release
- Run
../configure --with-osx_cocoa --disable-shared --with-opengl --enable-universal-binary=i386,x86_64 --with-macosx-version-min=10.6
- Run make, then sudo make install
- Change into wxwidgets/build-debug
- Run
../configure --enable-debug --with-osx_cocoa --with-opengl --enable-universal-binary=i386,x86_64 --with-macosx-version-min=10.6
- Run make, then sudo make install
4. Build
- For a release build:
mkdir build-ninja
cd build-ninja
cmake .. -GNinja
ninja
- To generate an Xcode project for developing with:
mkdir build-xcode
cd build-xcode
cmake .. -GXcode
open TrenchBroom.xcodeproj