-
Notifications
You must be signed in to change notification settings - Fork 105
/
INSTALL
95 lines (65 loc) · 2.95 KB
/
INSTALL
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
Installation
============
Open a terminal and browse into the extracted folder.
Linux:
1. `cmake -B build -S . -DCMAKE_INSTALL_PREFIX=/usr' to create a location
for the build and then configure the program. There are more options
you can pass to CMake, see below for details.
2. `cmake --build build' to compile the program.
3. `cmake --install build' to install the program. This has to be done
with root privileges if installing to system directories, but the
rest of the build should be done with regular user privileges.
For packaging you can optionally install the program into a temporary
directory by setting the DESTDIR environment variable. For example,
`DESTDIR="alternate/directory" cmake --install build' will prepend
'alternate/directory' before all installation names.
macOS:
1. `cmake -B build -S .' to create a location for the build and then
configure the program. There are more options you can pass to CMake,
see below for details.
2. `cmake --build build' to compile the program.
3. Run `mac_deploy.sh' from inside the build directory to create a disk
image of the program.
Windows:
1. `cmake -B ..\build -S .' to create a location for the build and then
configure the program. There are more options you can pass to CMake,
see below for details.
2. `cmake --build ..\build' to compile the program.
3. Run `windows_deploy.bat' from inside the build directory to create an
installer of the program. Note that you must have the NSIS executable
from nsis.sourceforge.io and the 7z executable from 7-zip.org in your
%PATH% for this to work.
Release Builds
==============
CMake does not specify any compiler optimizations by default; this is
useful if you want to inherit CFLAGS and CXXFLAGS from the environment.
You may want to add "-DCMAKE_BUILD_TYPE=Release" during configuration
to get an optimized build.
Debug Builds
============
You should create different directories for each type of build:
1. `cmake -B debug -S . -DCMAKE_BUILD_TYPE=Debug' to configure the sources.
2. `cmake --build debug' to compile the program.
More CMake Options
==================
-DCMAKE_BUILD_TYPE=<type>
Choose the type of build. Possible values are:
'None' 'Debug' 'Release' 'RelWithDebInfo' 'MinSizeRel'
-DENABLE_LINK_TIME_OPTIMIZATION=[OFF]
Reduce size by optimizing entire program at link time.
-DENABLE_STRIP=[OFF]
Reduce size by removing symbols.
Linux CMake Options
===================
-DCMAKE_INSTALL_PREFIX=<path>
Choose the base location where the program is installed
(defaults to /usr/local).
-DCMAKE_INSTALL_BINDIR=<path>
Choose where binaries are installed
(defaults to $CMAKE_INSTALL_PREFIX/bin).
-DCMAKE_INSTALL_DATADIR=<path>
Choose where the data files are installed
(defaults to $CMAKE_INSTALL_PREFIX/share).
-DCMAKE_INSTALL_MANDIR=<path>
Choose where manual pages are installed
(defaults to $CMAKE_INSTALL_DATADIR/man).