Template of a Modern C++ application with cmake, clang-tidy, clang-format, conan.
To create your own application based on this template follow the following steps:
- Press the green "Use this template button" at the top of this github page
- Clone the service
git clone your-service-repo && cd your-service-repo - Give a propper name to your service and replace all the occurences of "cxx_project_template" string with that name
(could be done via
find . -not -path ".git/*" -not -path './build_*' -type f | xargs sed -i 's/cxx_project_template/YOUR_APPLICATION_NAME/g').
Makefile contains typicaly useful targets for development:
make build-debug- debug build of the service with all the assertions and sanitizers enabledmake build-release- release build of the service with LTOmake test-debug- does amake build-debugand runs all the tests on the resultmake test-release- does amake build-releaseand runs all the tests on the resultmake format- run clang-format checks for all the C++ sourcesmake format-fix- run clang-format fixes for all the C++ sourcesmake clean- cleans the object filesmake dist-clean- clean all, including the CMake cached configurationsmake conan-setup- does a installation of all conan dependencies (automatically runs duringmake build-debugormake build-release)make lint- does a clang-tidy checksmake lint-fixdoes a clang-tidy fixes
Edit Makefile.local to change the default configuration and build options.