Debian Codegraph @

INSTALL

raw
1 Installation
2 ============
3
4 Open a terminal and browse into the extracted folder.
5
6 Linux:
7 1. `cmake -B build -S . -DCMAKE_INSTALL_PREFIX=/usr' to create a location
8 for the build and then configure the program. There are more options
9 you can pass to CMake, see below for details.
10
11 2. `cmake --build build' to compile the program.
12
13 3. `cmake --install build' to install the program. This has to be done
14 with root privileges if installing to system directories, but the
15 rest of the build should be done with regular user privileges.
16
17 For packaging you can optionally install the program into a temporary
18 directory by setting the DESTDIR environment variable. For example,
19 `DESTDIR="alternate/directory" cmake --install build' will prepend
20 'alternate/directory' before all installation names.
21
22 macOS:
23 1. `cmake -B build -S .' to create a location for the build and then
24 configure the program. There are more options you can pass to CMake,
25 see below for details.
26
27 2. `cmake --build build' to compile the program.
28
29 3. Run `mac_deploy.sh' from inside the build directory to create a disk
30 image of the program.
31
32 Windows:
33 1. `cmake -B ..\build -S .' to create a location for the build and then
34 configure the program. There are more options you can pass to CMake,
35 see below for details.
36
37 2. `cmake --build ..\build' to compile the program.
38
39 3. Run `windows_deploy.bat' from inside the build directory to create an
40 installer of the program. Note that you must have the NSIS executable
41 from nsis.sourceforge.io and the 7z executable from 7-zip.org in your
42 %PATH% for this to work.
43
44
45 Release Builds
46 ==============
47
48 CMake does not specify any compiler optimizations by default; this is
49 useful if you want to inherit CFLAGS and CXXFLAGS from the environment.
50 You may want to add "-DCMAKE_BUILD_TYPE=Release" during configuration
51 to get an optimized build.
52
53
54 Debug Builds
55 ============
56
57 You should create different directories for each type of build:
58
59 1. `cmake -B debug -S . -DCMAKE_BUILD_TYPE=Debug' to configure the sources.
60
61 2. `cmake --build debug' to compile the program.
62
63
64 More CMake Options
65 ==================
66
67 -DCMAKE_BUILD_TYPE=<type>
68 Choose the type of build. Possible values are:
69 'None' 'Debug' 'Release' 'RelWithDebInfo' 'MinSizeRel'
70
71 -DENABLE_LINK_TIME_OPTIMIZATION=[OFF]
72 Reduce size by optimizing entire program at link time.
73
74 -DENABLE_STRIP=[OFF]
75 Reduce size by removing symbols.
76
77
78 Linux CMake Options
79 ===================
80
81 -DCMAKE_INSTALL_PREFIX=<path>
82 Choose the base location where the program is installed
83 (defaults to /usr/local).
84
85 -DCMAKE_INSTALL_BINDIR=<path>
86 Choose where binaries are installed
87 (defaults to $CMAKE_INSTALL_PREFIX/bin).
88
89 -DCMAKE_INSTALL_DATADIR=<path>
90 Choose where the data files are installed
91 (defaults to $CMAKE_INSTALL_PREFIX/share).
92
93 -DCMAKE_INSTALL_MANDIR=<path>
94 Choose where manual pages are installed
95 (defaults to $CMAKE_INSTALL_DATADIR/man).