2019-08-07 05:06:55 +00:00
|
|
|
This is an example project using CMake.
|
|
|
|
|
|
|
|
The requirements are:
|
|
|
|
|
2022-06-02 14:30:14 -04:00
|
|
|
- CMake 3.11 or better; 3.14+ highly recommended.
|
|
|
|
- A C++17 compatible compiler
|
|
|
|
- The Boost libararies (header only part is fine)
|
|
|
|
- Git
|
|
|
|
- Doxygen (optional)
|
2019-08-07 05:06:55 +00:00
|
|
|
|
|
|
|
To configure:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cmake -S . -B build
|
|
|
|
```
|
|
|
|
|
|
|
|
Add `-GNinja` if you have Ninja.
|
|
|
|
|
|
|
|
To build:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cmake --build build
|
|
|
|
```
|
|
|
|
|
|
|
|
To test (`--target` can be written as `-t` in CMake 3.15+):
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cmake --build build --target test
|
|
|
|
```
|
|
|
|
|
|
|
|
To build docs (requires Doxygen, output in `build/docs/html`):
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cmake --build build --target docs
|
|
|
|
```
|
|
|
|
|
|
|
|
To use an IDE, such as Xcode:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cmake -S . -B xbuild -GXcode
|
|
|
|
cmake --open xbuild
|
|
|
|
```
|
|
|
|
|
2023-03-15 13:34:02 -04:00
|
|
|
The CMakeLists show off several useful design patterns for CMake.
|