Have a look at github.com/DerThorsten/cpptools, an unmodified example project created with this cpp_cookiecutter.
- Current features include:
- Readme on readthedocs.org
- Modern C++ 14
- Build system with modern CMake
- preconfigured conda recipe included
- Rendered projects have pre-configured CI scripts for: travis-ci circleci and azure-pipelines
- Rendering of projects itself is tested on several continuous integration plattforms as travis-ci circleci and azure-pipelines
- C++ unit tests with cpp doctest
- Benchmark code with google benchmark
- Docs with sphinx breathe and readthedocs support
- Google Benchmark and Doctest are downloaded at cmake-config time via external-projects since these dependencies are just for testing and benchmarking (and those are not yet available on conda)
- bumpversion
- Python bindings are created via pybind11
- An demo project github.com/DerThorsten/cpptools created by this cookiecutter, and automatically kept up to date via continuous integration
Install _cookiecutter
$ pip install cookiecutter
After installing cookiecutter, use the cpp-cookiecutter:
$ cookiecutter https://github.com/DerThorsten/cpp_cookiecutter
This cookiecutter is bet used in conjunction with conda: Assuming your package is named cpptools the following script shows the usage of the generated project cookiecutter on Linux/MacOS
cd cpptools
conda env create -f cpptools-dev-requirements.yml
source activate cpptools-dev-requirements
mkdir build
cd build
cmake ..
make -j2
make cpp-test
make python-test
cd examples
./hello_world
cd ..
cd benchmark
./benchmark_cpptools
On a windows machine this looks like:
cd cpptools
call activate cpptools-dev-requirements
mkdir build
cd build
cmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release ^
-DDEPENDENCY_SEARCH_PREFIX="%CONDA_PREFIX%\Library" -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library"
call activate cpptools-dev-requirements
cmake --build . --target ALL_BUILD
cmake --build . --target python-test
cmake --build . --target cpp-test
cd cpptools
call activate cpptools-dev-requirements
mkdir build
cd build
cmake .. -G"Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Release ^
-DDEPENDENCY_SEARCH_PREFIX="%CONDA_PREFIX%\Library" -DCMAKE_PREFIX_PATH="%CONDA_PREFIX%\Library"
call activate cpptools-dev-requirements
cmake --build . --target ALL_BUILD
cmake --build . --target python-test
cmake --build . --target cpp-test