aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMAKE.md
blob: 09ce1430128b01ceb369e90fd144ce269640cd58 (plain)
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
# Building with CMake

Some portions of this repository are portable beyond iOS and can be built using
CMake.

## Dependencies

You need:
  * A C++ compiler
  * `cmake`

### macOS

You need [Xcode](https://developer.apple.com/xcode/), which you can get from
the Mac App Store.

You can get other development tools via [homebrew](https://brew.sh). Adjust as
needed for other package managers.
```
brew install cmake
```

### Ubuntu

Ubuntu Trusty includes CMake 2.8.12 which should be sufficient. Newer versions
are fine too.

```
sudo apt-get install cmake
```

### Windows

An easy way to get development tools is via [Chocolatey](https://chocolatey.org/).

Unfortunately, the `cmake.install` package is semi-broken, so use the portable
version.

```
choco install cmake.portable
```

## Setup

CMake builds out-of source, so create a separate build directory for the target
you want to work on.

```
mkdir build
cd build
cmake ..
```

## Testing

Once CMake has run once, you can just run `make` repeatedly and it will
regenerate Makefiles as needed.

To build everything and run tests:
```
make -j all test
```