]> git.xonotic.org Git - xonotic/netradiant.git/blob - README.md
6f6e5c7668ac82f226aeb6d9224a407f6c5d4aeb
[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 idtech games (Radiant fork).
7
8 # Getting the sources
9
10 The latest source is available from the git repository:
11 https://gitlab.com/xonotic/netradiant.git
12
13 The git client can be obtained from the Git website:
14 http://git-scm.org
15
16 To get a copy of the source using the command line git client:
17
18 ```
19 git clone --recursive https://gitlab.com/xonotic/netradiant.git
20 cd netradiant
21 ```
22
23 See also https://gitlab.com/xonotic/netradiant/ for a source browser, issues and more.
24
25 # Dependencies
26
27 * OpenGL
28 * LibXml2
29 * GTK2
30 * GtkGLExt
31 * LibJpeg
32 * LibPng
33 * LibWebp
34 * Minizip
35 * ZLib
36
37 ## msys2
38
39 Under MSYS2, the mingw shell must be used.
40
41 If you use MSYS2 over SSH, add `mingw64` to the path this way (given you compile for 64 bit windows): 
42
43 ```
44 export PATH="/mingw64/bin:${PATH}"`
45 ```
46
47 Install the dependencies this way:
48
49
50 ```
51 pacman -S --needed base-devel mingw-w64-$(uname -m)-{toolchain,cmake,make,gtk2,gtkglext,libwebp,minizip-git} git
52 ```
53
54 Explicitely use `mingw-w64-x86_64-` or `mingw-w64-i686-` prefix if you need to target a non-default architecture.
55
56 You may have to install `subversion` to fetch some non-default game packages.
57
58
59 ## macOS:
60
61 ```
62 brew install gcc cmake Caskroom/cask/xquartz gtkglext pkgconfig minizip webp coreutils gnu-sed
63 brew link --force gettext
64 ```
65
66 # Submodules
67
68  * Crunch (optional, disabled by default, only supported with CMake build)
69
70 If you have not used `--recursive` option at `git clone` time, you can fetch Crunch this way (run it within the NetRadiant repository):
71
72
73 ```
74 git submodule update --init --recursive
75 ```
76
77 # Compiling
78
79 This project uses the usual CMake workflow:
80
81 ## Debug
82
83 ```
84 cmake -G "Unix Makefiles" -H. -Bbuild && cmake --build build -- -j$(nproc)
85 ```
86
87 ## Release
88
89 ```
90 cmake -G "Unix Makefiles" -H. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build -- -j$(nproc)
91 ```
92
93 On Mac you have to add this to the first cmake call:
94
95 ```
96 -DCMAKE_C_COMPILER=/usr/local/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9 -DOPENGL_INCLUDE_DIR=/opt/X11/include -DOPENGL_gl_LIBRARY=/opt/X11/lib/libGL.dylib
97 ```
98
99 ## Build and installation details
100
101 ### Compilation details
102
103 options:
104
105 * `BUILD_RADIANT=OFF`  
106    Do not build NetRadiant (default: `ON`, build radiant graphical editor)
107 * `BUILD_TOOLS=OFF`  
108    Do not build q3map2 and other tools (default: `ON`, build command line tools)
109 * `BUILD_CRUNCH=ON`  
110    Enable crunch support (default: `OFF`, disable crunch support)
111 * `RADIANT_ABOUTMSG="Custom build"`  
112    A message shown in the about dialog
113
114 targets:
115
116 * `radiant`    Compiles the radiant core binary
117 * `modules`    Compiles all modules (each module has its own target as well)
118 * `plugins`    Compiles all plugins (each plugin has its own target as well)
119 * `quake3`     Compiles all the Quake3 tools
120   - `q3map2`   Compiles the quake3 map compiler
121   - `q3data`   Compiles the q3data tool
122
123 ### Download details
124
125 options:
126
127 * `DOWNLOAD_GAMEPACKS=OFF`  
128    Do not automatically download the gamepack data during the first compilation (default: `ON`)
129 * `GAMEPACKS_LICENSE_LIST=all`  
130    Download all gamepacks whatever the license (default: `free`, download free gamepacks)
131 * `GAMEPACKS_NAME_LIST=Xonotic Unvanquished`  
132    Download gamepacks for the given games (default: `none`, do not select more gamepacks to download)
133
134 target:
135
136 * `game_packs` Downloads the game pack data
137
138 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.
139
140 ### Installation details
141
142 options:
143
144 * `FHS_INSTALL=ON`  
145   Install files following the Filesystem Hierarchy Standard (bin, lib, share, etc.), also setup XDG mime and application support on POSIX systems (default: `OFF`, install like in 1999)
146 * `CMAKE_INSTALL_PREFIX=/usr`  
147   Install system-wide on Posix systems, always set `FHS_INSTALL` to `ON` when doing this (default: install in `install/` directory within source tree)
148
149 target:
150
151 * `install`  
152   Install files
153
154 ## Note about Crunch
155
156 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.