A CMake template with doctest and Google Benchmark.
-
Clone this repository.
-
Squash all the history to make an initial commit.
git reset $(git commit-tree HEAD^{tree} -m "Initial commit")
-
Amend the initial commit by adding/deleting/modifying files. It may be useful to see results of
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
) ENABLE_NATIVE=ON
(CMakeLists.txt
)- Coding conventions: Google (
.clang-format
) - Continuous integration (
.travis.yml
,.gitlab-ci.yml
)
A typical CMake build process on Linux is
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