Demo 0.0.1
Example C++ project
|
This is a cmake based C++ demo project. You can quickly and easily boostrap a new C++ cmake project from this git repository.
It is not easy to set up a new C++ repository from scratch. This repository is a good start, and you can build your project from here.
This demo project includes almost everything that a rigorous project should have.
git clone https://github.com/wangzw/cxx-cmake-project-template.git
bootstrap.sh YourProjectName
to change project nameNow, you are almost done to bootstrap a new project. And then you can set up your development environment with DevContainer or just start a Docker container using docker compose
With DevContainer:
With Docker compose:
And now you have a container based development environment with all dependencies.
Some CMake functions and predefined targets are created to ease the use of CMake.
The following functions are used to add your targets. Replace xxx
to your project name in lower case. They have covered many details such as clang-tidy, code coverage, code sanitizer and installation.
And there are also some predefined targets:
When you add your own third party dependencies into thirdparty/CMakeLists.txt
or update Dockerfile, you need to build your own docker image.
docker-compose.yml
and workflow files in .github/workflows/
.docker build -t your-image-name .
You can build and push your own docker image to your image repository manually. Or build your image using Github workflows. Check workflow file .github/workflows/image.yml
for details.