diff --git a/index.html b/index.html index 9f90677..a15e937 100644 --- a/index.html +++ b/index.html @@ -51,7 +51,7 @@
Setting up a new C++ project usually requires a significant amount of preparation and boilerplate code, even more so for modern C++ projects with tests, executables and continuous integration. This template is the result of learnings from many previous projects and should help reduce the work required to setup up a modern C++ project.
CODECOV_TOKEN
Eventually, you can remove any unused files, such as the standalone directory or irrelevant github workflows for your project. Feel free to replace the License with one suited for your project.
To cleanly separate the library and subproject code, the outer CMakeList.txt
only defines the library itself while the tests and other subprojects are self-contained in their own directories. During development it is usually convenient to build all subprojects at once.
Use the following command to build and run the executable target.
cmake -Hstandalone -Bbuild/standalone +ModernCppStarter
Setting up a new C++ project usually requires a significant amount of preparation and boilerplate code, even more so for modern C++ projects with tests, executables and continuous integration. This template is the result of learnings from many previous projects and should help reduce the work required to setup up a modern C++ project.
Features
- Modern CMake practices
- Suited for single header libraries and projects of any scale
- Clean separation of library and executable code
- Integrated test suite
- Continuous integration via GitHub Actions
- Code coverage via codecov
- Code formatting enforced by clang-format and cmake-format via Format.cmake
- Reproducible dependency management via CPM.cmake
- Installable target with automatic versioning information and header generation via PackageProject.cmake
- Automatic documentation and deployment with Doxygen and GitHub Pages
- Support for sanitizer tools, and more
Usage
Adjust the template to your needs
- Use this repo as a template.
- Replace all occurrences of "Greeter" in the relevant CMakeLists.txt with the name of your project
- Capitalization matters here:
Greeter
means the name of the project, whilegreeter
is used in file names.- Remember to rename the
include/greeter
directory to use your project's lowercase name and update all relevant#include
s accordingly.- Replace the source files with your own
- For header-only libraries: see the comments in CMakeLists.txt
- Add your project's codecov token to your project's github secrets under
CODECOV_TOKEN
- Happy coding!
Eventually, you can remove any unused files, such as the standalone directory or irrelevant github workflows for your project. Feel free to replace the License with one suited for your project.
To cleanly separate the library and subproject code, the outer
CMakeList.txt
only defines the library itself while the tests and other subprojects are self-contained in their own directories. During development it is usually convenient to build all subprojects at once.Build and run the standalone target
Use the following command to build and run the executable target.
cmake -Hstandalone -Bbuild/standalone cmake --build build/standalone ./build/standalone/Greeter --helpBuild and run test suite
Use the following commands from the project's root directory to run the test suite.
cmake -Htest -Bbuild/test cmake --build build/test