https://github.com/tueda/cmake-template
A CMake template with unit-testing and micro-benchmarking.
https://github.com/tueda/cmake-template
benchmarking c-plus-plus-11 cmake template unit-testing
Last synced: 10 months ago
JSON representation
A CMake template with unit-testing and micro-benchmarking.
- Host: GitHub
- URL: https://github.com/tueda/cmake-template
- Owner: tueda
- Created: 2018-03-08T10:22:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-10T13:17:17.000Z (over 8 years ago)
- Last Synced: 2025-03-22T13:43:05.314Z (about 1 year ago)
- Topics: benchmarking, c-plus-plus-11, cmake, template, unit-testing
- Language: Python
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
cmake-template
==============
[](https://travis-ci.org/tueda/cmake-template)
[](https://gitlab.com/tueda/cmake-template/commits/master)
A [CMake](https://cmake.org/) template with
[doctest](https://github.com/onqtam/doctest) and
[Google Benchmark](https://github.com/google/benchmark).
Get started
===========
1. Clone this repository.
2. Squash all the history to make an initial commit.
```shell
git reset $(git commit-tree HEAD^{tree} -m "Initial commit")
```
3. Amend the initial commit by adding/deleting/modifying files. It may be useful
to see results of
```shell
git ls-files # list of files in the repository
git grep -n foo # lines containing the dummy project name "foo"
```
Arguable default values you might want to look into:
- Compiler warning flags ([`CMakeLists.txt`](CMakeLists.txt))
- `ENABLE_NATIVE=ON` ([`CMakeLists.txt`](CMakeLists.txt))
- Coding conventions: Google ([`.clang-format`](.clang-format))
- Continuous integration ([`.travis.yml`](.travis.yml), [`.gitlab-ci.yml`](.gitlab-ci.yml))
Build
=====
A typical CMake build process on Linux is
```shell
git submodule update --init
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/path/to/install ..
make
make check
make bench
make install
```