]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - README.md
h2data: fix build on macos
[xonotic/netradiant.git] / README.md
1 NetRadiant
2 ==========
3
4 ![NetRadiant logo](setup/data/tools/bitmaps/splash.png)
5
6 The open source, cross platform level editor for id Tech-derivated games (Radiant fork).
7
8 # Getting the sources
9
10 The latest source is available from the git repository:
11
12 https://gitlab.com/xonotic/netradiant.git
13
14 The git client can be obtained from the Git website:
15
16 http://git-scm.org
17
18 To get a copy of the source using the command line git client:
19
20 ```
21 git clone --recursive https://gitlab.com/xonotic/netradiant.git
22 cd netradiant
23 ```
24
25 See also https://gitlab.com/xonotic/netradiant/ for a source browser, issues and more.
26
27 # Dependencies
28
29 * OpenGL
30 * LibXml2
31 * GTK2
32 * GtkGLExt
33 * LibJpeg
34 * LibPng
35 * LibWebp
36 * Minizip
37 * ZLib
38
39 To fetch default game packages you'll need Git and to fetch some optional ones you'll need Subversion.
40
41 ## MSYS2
42
43 Under MSYS2, the mingw shell must be used.
44
45 If you use MSYS2 over SSH, add `mingw64` to the path this way (given you compile for 64 bit windows): 
46
47 ```
48 export PATH="/mingw64/bin:${PATH}"`
49 ```
50
51 Install the dependencies this way:
52
53
54 ```
55 pacman -S --needed base-devel mingw-w64-$(uname -m)-{toolchain,cmake,make,gtk2,gtkglext,libwebp,minizip-git} git
56 ```
57
58 Explicitely use `mingw-w64-x86_64-` or `mingw-w64-i686-` prefix if you need to target a non-default architecture.
59
60 You may have to install `subversion` and `unzip` to fetch or extract some non-default game packages.
61
62
63 ## macOS:
64
65 ```
66 brew install gcc cmake gtkglext pkgconfig minizip webp coreutils gnu-sed
67 brew link --force gettext
68 ```
69
70 # Submodules
71
72  * Crunch (optional, disabled by default, only supported with CMake build)
73
74 If you have not used `--recursive` option at `git clone` time, you can fetch Crunch this way (run it within the `netradiant` repository):
75
76
77 ```
78 git submodule update --init --recursive
79 ```
80
81 # Compiling
82
83 This project uses the usual CMake workflow:
84
85 ## Debug
86
87 ```
88 cmake -G "Unix Makefiles" -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug && cmake --build build -- -j$(nproc)
89 ```
90
91 ## Release
92
93 ```
94 cmake -G "Unix Makefiles" -H. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build -- -j$(nproc)
95 ```
96
97 On macOS you have to add this to the first cmake call:
98
99 ```
100 -DCMAKE_C_COMPILER=/usr/local/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9
101 ```
102
103 On FreeBSD you have to add this to the first cmake call:
104
105 ```
106 -DCMAKE_C_COMPILER=/usr/local/bin/gcc8 -DCMAKE_CXX_COMPILER=/usr/local/bin/g++8
107 ```
108
109 ## Build and installation details
110
111 ### Compilation details
112
113 options:
114
115 * `BUILD_RADIANT=OFF`  
116    Do not build NetRadiant (default: `ON`, build radiant graphical editor)
117 * `BUILD_TOOLS=OFF`  
118    Do not build q3map2 and other tools (default: `ON`, build command line tools)
119 * `BUILD_CRUNCH=ON`  
120    Enable crunch support (default: `OFF`, disable crunch support)
121 * `RADIANT_ABOUTMSG="Custom build"`  
122    A message shown in the about dialog
123
124 targets:
125
126 * `radiant`    Compiles the radiant core binary
127 * `modules`    Compiles all modules (each module has its own target as well)
128 * `plugins`    Compiles all plugins (each plugin has its own target as well)
129 * `quake3`     Compiles all the Quake3 tools
130   - `q3map2`   Compiles the quake3 map compiler
131   - `q3data`   Compiles the q3data tool
132
133 ### Download details
134
135 options:
136
137 * `DOWNLOAD_GAMEPACKS=OFF`  
138    Do not automatically download the gamepack data during the first compilation (default: `ON`)
139 * `GAMEPACKS_LICENSE_LIST=all`  
140    Download all gamepacks whatever the license (default: `free`, download free gamepacks, can be set to `none` to only filter by name)
141 * `GAMEPACKS_NAME_LIST="Xonotic Unvanquished"`  
142    Download gamepacks for the given games (default: `none`, do not select more gamepacks to download)
143
144 target:
145
146 * `game_packs` Downloads the game pack data
147
148 Run `./gamepacks-manager -h` to know about available licenses and other available games. Both lists are merged, for example setting `GAMEPACKS_LICENSE_LIST=GPL` and `GAMEPACKS_NAME_LIST=Q3` will install both GPL gamepacks and proprietary Quake 3 one.
149
150 ### Installation details
151
152 options:
153
154 * `FHS_INSTALL=ON`  
155   Available for POSIX systems: install files following the Filesystem Hierarchy Standard (bin, lib, share, etc.), also setup XDG mime and application support on Linux-like systems (default: `OFF`, install like in 1999)
156 * `CMAKE_INSTALL_PREFIX=/usr`  
157   Install system-wide on Posix systems, always set `FHS_INSTALL` to `ON` when doing this (default: install in `install/` directory within source tree)
158
159 target:
160
161 * `install`  
162   Install files
163
164 Note that because of both the way NetRadiant works and the way bundled library loading works CMake has to do some globbing to detect some of the produced/copied files it has to install. So you have to run cmake again before installing:
165
166 ```
167 cmake -H. -Bbuild && cmake --build build -- install
168 ```
169
170 ## Note about Crunch
171
172 The crnlib used to decode `.crn` files is the one from [Dæmon](http://github.com/DaemonEngine/Daemon) which is the one by [Unity](https://github.com/Unity-Technologies/crunch/tree/unity) made cross-platform and slightly improved. Since Unity brokes compatibility with [BinomialLLC's legacy tree](https://github.com/BinomialLLC/crunch) it's required to use either the `crunch` tool from Dæmon or the one from Unity to compress textures that have to be read by radiant or q3map2.