- Notifications
You must be signed in to change notification settings - Fork11
A modern cmake starter project for C++ with a complete build lifecycle, testing, dependency management, etc. Portable across Linux, OS X and Windows.
License
abdes/asap
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A complete starter project for C++ projects built withCMake.
Key Features •Project Documentation •Getting Started •Contributing •Credits •
Have you ever found yourself spending countless hours trying to figure out howto start a professional C++ project with unit tests, a robust dev workflow,change logs, code coverage, linting, formatting...? The C++ ecosystem is gettingbetter but is still very far away from other ecosystems such as JavaScript, oreven Rust. It's certainly easy to use CMake, a compiler and vscode to start ahello world project, but as soon as you start having multiple modules, withthird party dependencies, testing, coverage, and other development things that aprofessional quality project needs, you start wasting hours and hourstroubleshooting and configuring until you make it work.
Waste your time no more!
This starter project solves most of your problems, using the best practices forC++ development and modern CMake and allows you to get started in minutes ratherthan days.
CMake
as the build system with or without presets- cross-platform portability on Linux, OS X and Windows
- multiple compilers: clang, g++ and MSVC
- modular structure with each module self-contained in a subdirectory within theproject
CMake
build helpers to facilitate declaration of library, exe, test modules,for the end-to-end lifecycle including doc generation, test, packaging etc...- unit testing targets, with by default Google Test as the framework (otherframeworks are also possible)
- code coverage with clang or g++
- zero-touch valgrind, clang-tidy, clang-format, google sanitizers, etc
- development can be done locally or in a dev container with vscode
- faster rebuilds with
ccache
empowered caching CMake
package management withCPM
We have detailed guides for setting up an efficient development environment, thedevelopment process, project structure, etc. Take a look at the project's githubpageshere.
It is strongly recommended that you take some time to browse the projectdocumentation to familiarize yourself with its structure and developmentworkflows.
For the impatient, or the already experts, below is a short tutorial video forhow to start from asap to make your own project.
In this step, we'll clean up the freshly created repo and prepare it for beingcustomized.
In this step, we'll go into Visual Studio Code to do some heavier customizationswhile tracking our changes in git.
For this final tutorial, we will ad an executable module to implement the famous"Hello World!". You can see how simple it is and how fast it is to hit theground running with asap and start focusing on what matters the most: coding.
Take some time to explore the different build targets in the project, and thedocumentation to add tests, documentation etc.
If you would like to contribute code you can do so through GitHub by forking therepository and sending a pull request. When submitting code, please make everyeffort to follow existing conventions and style in order to keep the code asreadable as possible.
By contributing your code, you agree to license your contribution under theterms of the BSD-3-Clause or a more permissive license. All files are releasedwith the BSD-3-Clause license.
Read thedeveloper guides.
- For every PR there should be an accompanying issue which the PR solves
- The PR itself should only contain code which is the solution for the givenissue
- If you are a first time contributor check if there is a suitable issue for you
- Swift Navigation for theircmake commontools project, an excellent startingpoint for several of the features in this starter project,
- The multitude of other open-source projects used to implement this project orto get inspiration - credits in the source code or the documentation asappropriate
About
A modern cmake starter project for C++ with a complete build lifecycle, testing, dependency management, etc. Portable across Linux, OS X and Windows.