Skip to content

Latest commit

 

History

History
136 lines (95 loc) · 4.73 KB

README.rst

File metadata and controls

136 lines (95 loc) · 4.73 KB

Cookiecutter C++

Build Status

Cookiecutter template for a C++ package.

Credits

This is basically a fork of Cookiecutter.

Features

Quickstart

Install the latest Cookiecutter if you haven't installed it yet (this requires Cookiecutter 1.4.0 or higher):

pip install -U cookiecutter

Generate a Python package project:

cookiecutter https://github.com/grhawk/cookiecutter-cpp.git

Enter the newly generated folder. Make sure the Conan profile is configured:

conan profile list

If you don't have a Conan profile, you can create one with conan profile detect --force. At this point, according to CMake-Conan-Integration, you can run:

mkdir build && cd build;
cmake -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/conan_provider.cmake ..
cmake --build .

This will prepare the needed C++ libraries and compile the example code. You can now test the compiled code:

./sandbox/cpp_boilerplate-sandbox

and run the unittests:

ctest

The created folder is already a git repo that you can push on github and has already a basic CI implemented to test the code with CircleCI.

For more details, see the cookiecutter-pypackage tutorial.

Not Exactly What You Want?

Don't worry, you have options:

Fork This / Create Your Own

If you have differences in your preferred setup, I encourage you to fork this to create your own version. Or create your own; it doesn't strictly have to be a fork.

  • Once you have your own version working, add it to the Similar Cookiecutter Templates list above with a brief description.
  • It's up to you whether or not to rename your fork/own version. Do whatever you think sounds good.

Contributing

  1. Fork the project.
  2. Edit whatever you feel like.
  3. Describe the changes on the "unreleased" tag in the CHANGELOG.md.
  4. Create a Merge Request to the main branch.

Once a new branch has been merged, it is enough to create a new semver tag to generate a new version of the cookiecutter repo.