forked from libgeos/geos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
92 lines (61 loc) · 2.53 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
## Building GEOS From Source
### Prerequisites
GEOS has no external library dependencies and can be built with any C++11
compiler.
### Unix
GEOS can be built on Unix systems using either the autotools or CMake build
systems.
#### Using Autotools:
When building GEOS using autotools, a `configure` script must first be generated
using the `autogen.sh` file included in the root of the repository:
./autogen.sh
An out-of-tree build can then be initiated by creating a subdirectory and
running the generated `configure` script from that subdirectory:
mkdir obj && cd obj && ../configure
Once the `configure` script has run, GEOS can be built by running `make` and
installed by running `make install`. The test suite can be run using `make
check`.
#### Using CMake:
To build `GEOS` using CMake, create a build directory and run the `cmake` command
from that location:
mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..
Setting `CMAKE_BUILD_TYPE` to `Release` is necessary to enable compiler
optimizations.
Once the `cmake` tool has run, GEOS can be built by running `make` and
installed by running `make install`.
The entire test suite can be run using `make check`.
Alternatively, the `ctest` command can be used, which provides more control over test execution.
For example, `ctest -R unit-capi -j2` uses a regular expression to run all tests
associated with the C API, using two processes in parallel.
A list of available tests can be obtained using `ctest -N`.
### Microsoft Windows
GEOS can be built with Microsoft Visual C++ by opening the `CMakeLists.txt` in
the project root using `File > Open > CMake`.
If you prefer the command-line
#### Build with CMake generator for Ninja (fast)
In the Visual Studio 2019 command prompt, `x64 Native Tools Command Prompt for VS 2019` or `x64_x86 Cross Tools Command Prompt for VS 2019`:
```
cmake -S . -B _build_vs2019_ninja -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build _build_vs2019_ninja -j 16 --verbose
```
#### Build with CMake generator for MSBuild (default)
In the non-specific Command Prompt:
##### 64-bit
```
cmake -S . -B _build_vs2019x64 -G "Visual Studio 16 2019" -A x64 -DCMAKE_GENERATOR_TOOLSET=host=x64
cmake --build _build_vs2019x64 --config Release -j 16 --verbose
```
##### 32-bit
```
cmake -S . -B _build_vs2019x32 -G "Visual Studio 16 2019" -A x32 -DCMAKE_GENERATOR_TOOLSET=host=x64
cmake --build _build_vs2019x32 --config Release -j 16 --verbose
```
#### Test using CMake
```
cd <build directory>
ctest --show-only
ctest
ctest --output-on-failure
ctest -V
ctest -VV
```