Skip to content

Commit 9f90026

Browse files
authored
Update README.md
1 parent e4e84bb commit 9f90026

File tree

1 file changed

+61
-1
lines changed

1 file changed

+61
-1
lines changed

README.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ sudo apt install build-essential cmake ninja-build clang-format clang-tidy cppch
8282

8383
**Note:** the project gracefully skips unavailable tools and emits a warning if optional tools aren't found.
8484

85-
### Build Presets and Tools
85+
### Build Presets
8686

8787
This project uses [**CMake Presets**](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) to simplify and standardize configuration and build workflows. Each preset is tailored to a specific purpose.
8888

@@ -99,6 +99,66 @@ Run to list all presets:
9999
cmake --list-presets
100100
```
101101

102+
### Building the Project
103+
104+
> All commands assume you are using CMake Presets, which are fully configured for this project.
105+
106+
#### Configure and Build
107+
108+
To configure and build using a preset:
109+
```bash
110+
cmake --preset gcc-RelWithDebInfo
111+
cmake --build --preset gcc-RelWithDebInfo
112+
```
113+
114+
### Run Tests
115+
116+
All tests are built with [GoogleTest](https://github.com/google/googletest). Enable them with the `ENABLE_TESTING` option (**enabled** by default).
117+
118+
```bash
119+
cmake --preset gcc-RelWithDebInfo
120+
cmake --build --preset gcc-RelWithDebInfo
121+
ctest --preset gcc-RelWithDebInfo
122+
```
123+
124+
### Sanitizers
125+
126+
The `Sanitize` build type enables runtime checks for memory errors (AddressSanitizer, UndefinedBehaviorSanitizer).
127+
128+
```bash
129+
cmake --preset gcc-Sanitize
130+
cmake --build --preset gcc-Sanitize
131+
ctest --preset gcc-Sanitize
132+
```
133+
134+
### Generate Code Coverage
135+
136+
Use the `Coverage` preset to instrument code and generate a coverage report (requires `lcov` and `genhtml`):
137+
```bash
138+
cmake --preset gcc-Coverage
139+
cmake --build --preset gcc-Coverage
140+
ctest --preset gcc-Coverage
141+
cmake --build --preset gcc-Coverage --target coverage
142+
```
143+
144+
View the report in:
145+
```bash
146+
build/gcc-Coverage/coverage-report/index.html
147+
```
148+
149+
### Install the Library
150+
151+
```bash
152+
cmake --preset gcc-Release
153+
cmake --build --preset gcc-Release
154+
cmake --install build/gcc-Release --prefix install # or /usr/local
155+
```
156+
157+
This installs:
158+
- Compiled static/shared libraries
159+
- Public headers from `include/`
160+
- CMake config files for `find_package(...)` consumers
161+
102162
## Contributing
103163

104164
Pull requests are welcome. Please ensure:

0 commit comments

Comments
 (0)