|
1 | 1 | # Building with CMake |
2 | 2 |
|
3 | | -## Build |
4 | | - |
5 | | -This project doesn't require any special command-line flags to build to keep |
6 | | -things simple. |
7 | | - |
8 | | -Here are the steps for building in release mode with a single-configuration |
9 | | -generator, like the Unix Makefiles one: |
| 3 | +Enabling developer mode will build the benchmarks, tests, and examples. |
10 | 4 |
|
11 | 5 | ```sh |
12 | 6 | cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D BINARY_LOG_DEVELOPER_MODE=ON |
13 | 7 | cmake --build build |
14 | 8 | ``` |
15 | 9 |
|
16 | | -Here are the steps for building in release mode with a multi-configuration |
17 | | -generator, like the Visual Studio ones: |
18 | | - |
19 | | -```sh |
20 | | -cmake -S . -B build -D CMAKE_BUILD_TYPE=Release -D BINARY_LOG_DEVELOPER_MODE=ON |
21 | | -cmake --build build --config Release |
22 | | -``` |
23 | | - |
24 | | -## Install |
25 | | - |
26 | | -This project doesn't require any special command-line flags to install to keep |
27 | | -things simple. As a prerequisite, the project has to be built with the above |
28 | | -commands already. |
29 | | - |
30 | | -The below commands require at least CMake 3.15 to run, because that is the |
31 | | -version in which [Install a Project][1] was added. |
32 | | - |
33 | | -Here is the command for installing the release mode artifacts with a |
34 | | -single-configuration generator, like the Unix Makefiles one: |
| 10 | +Here is the command for installing the release mode artifacts: |
35 | 11 |
|
36 | 12 | ```sh |
37 | 13 | cmake --install build |
38 | 14 | ``` |
39 | 15 |
|
40 | | -Here is the command for installing the release mode artifacts with a |
41 | | -multi-configuration generator, like the Visual Studio ones: |
| 16 | +# Running the Tests |
42 | 17 |
|
43 | | -```sh |
44 | | -cmake --install build --config Release |
45 | | -``` |
| 18 | +Once built, you can run the tests like so: |
46 | 19 |
|
47 | | -[1]: https://cmake.org/cmake/help/latest/manual/cmake.1.html#install-a-project |
| 20 | +```console |
| 21 | +foo@bar:~/dev/binary_log$ ./build/test/binary_log_test |
| 22 | +[doctest] doctest version is "2.3.5" |
| 23 | +[doctest] run with "--help" for options |
| 24 | +=============================================================================== |
| 25 | +[doctest] test cases: 10 | 10 passed | 0 failed | 0 skipped |
| 26 | +[doctest] assertions: 522 | 522 passed | 0 failed | |
| 27 | +[doctest] Status: SUCCESS! |
| 28 | +``` |
0 commit comments