https://github.com/benslabbert/cpp-googletest-cmake-example
https://github.com/benslabbert/cpp-googletest-cmake-example
cmake cpp docker gcov
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/benslabbert/cpp-googletest-cmake-example
- Owner: BenSlabbert
- Created: 2019-09-05T13:57:15.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-06T09:40:33.000Z (almost 7 years ago)
- Last Synced: 2025-07-25T03:29:20.877Z (11 months ago)
- Topics: cmake, cpp, docker, gcov
- Language: CMake
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CPP Googletest + spdlog cmake example
This is an example of including 2 external CMake projects ([googletest](https://github.com/google/googletest.git) and [spdlog](https://github.com/gabime/spdlog.git)).
CMake will clone these repos and checkout the specified tags.
Additionally this also shows how to create your own static library to be used in the project.
See the [proxy](./proxy) `dir`, this is where we set up all the code to be used as a library in the [main](./cmd/main.cpp) program where we can now `#include ` our classes.
We also have a example of using `gcov` as a custom target to run after all our tests.
As always (as there should be) check out the [Dockerfile](./Dockerfile) to see how to build this project.
## Requirements
Must have cmake > 3.15
## Build
Run `cmake .` which will clone all the dependencies and build the project.
Subsequently you can run `make`.
## Output
In the `cmd/bin` dir there will be 2 binaries: `main` and `main_test`