![Logo](/gokulp01/minimal-cpp-cookiecutter/raw/main/logo.png)
This repository contains a simple C++ project template for Cookiecutter that I use for most of my C++ projects.
Report Bug
·
Request Feature
Table of Contents
This is a very simple kickstarter cookiecutter for cpp projects and research work for quick prototyping and implementations.
- CMake
- Catch
- Cookiecutter
- Simple C++ project structure
- CMake build system
- Catch for unit tests
- Cookiecutter for project creation
- Git for version control
- GitHub for hosting
To install CMake on your system, follow these steps:
For macOS:
brew install cmake
For Ubuntu:
sudo apt-get update
sudo apt-get install cmake
For Windows:
Download and run the installer from the CMake official website.
To install Cookiecutter, you need Python installed on your system. Then, you can install Cookiecutter using pip:
pip install cookiecutter
To create a new C++ project using this template, follow these steps:
- Open your terminal.
- Navigate to the directory where you want to create your project.
- Run the following command:
cookiecutter gh:gokulp01/minimal-cpp-cookiecutter
- Cookiecutter will prompt you to enter values for various options, such as the project name, project slug, author's name, etc. Input your desired values for these fields.
- Once you complete the prompts, Cookiecutter will create a new directory containing the scaffolded C++ project based on the values you provided.
- Navigate into your new project directory: cd your-project-slug - Replace
your-project-slug
with the project slug you provided during the setup. - Now, you can begin working on your C++ project. The directory will contain a basic project structure, including source files, a CMake configuration file, and any additional boilerplate specified in your template.
- To build your project, you can use CMake as follows: mkdir build && cd build && cmake .. && make - This will compile your C++ project and generate executable files in the
build
directory.
By following these steps, you can quickly bootstrap a new C++ project using the simple cookie-cutter template. Your folder tree should look like this
├── CMakeLists.txt
├── bin
├── build
├── main.cpp
├── src
│ ├── myclass.cpp
│ └── myclass.hpp
└── tests
├── CMakeLists.txt
├── SmokeTests.cpp
├── bin
├── build
└── catch.hpp
- Add support for Travis CI
- Add support for AppVeyor
- Add support for Conan
- Add support for Doxygen
- Add support for Cppcheck
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Gokul Puthumanaillam - @twitter_handle - [email protected]/[email protected]
Website - gokulp01.github.io