]> de.git.xonotic.org Git - xonotic/netradiant.git/blob - README.md
Merge branch 'heretic2' into 'master'
[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)-{ntldd-git,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 * `tools`      Compiles all tools (each tool has its own target as well)
130   - `quake2`   Compiles all the Quake2 tools: `q2map`, `qdata3`
131   - `heretic2` Compiles all the Heretic2 tools: `q2map`, `h2data`
132   - `quake3`   Compiles all the Quake3 tools:
133      * `q3map2` Compiles the quake3 map compiler
134      * `q3data` Compiles the q3data tool
135
136 Type `make help` to get an exhaustive list of targets.
137
138 ### Download details
139
140 options:
141
142 * `DOWNLOAD_GAMEPACKS=OFF`  
143    Do not automatically download the gamepack data during the first compilation (default: `ON`)
144 * `GAMEPACKS_LICENSE_LIST=all`  
145    Download all gamepacks whatever the license (default: `free`, download free gamepacks, can be set to `none` to only filter by name)
146 * `GAMEPACKS_NAME_LIST="Xonotic Unvanquished"`  
147    Download gamepacks for the given games (default: `none`, do not select more gamepacks to download)
148
149 target:
150
151 * `game_packs` Downloads the game pack data
152
153 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.
154
155 ### Installation details
156
157 options:
158
159 * `FHS_INSTALL=ON`  
160   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)
161 * `CMAKE_INSTALL_PREFIX=/usr`  
162   Install system-wide on Posix systems, always set `FHS_INSTALL` to `ON` when doing this (default: install in `install/` directory within source tree)
163
164 target:
165
166 * `install`  
167   Install files
168
169 ## Note about Crunch
170
171 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.