C++ Project Template
Introduction
A C++ project template built with:
Building without Docker
Prerequisites
- Install GoogleTest.
- Install CMake.
Building
Set the location to the project folder and run:
mkdir build
cd build
cmake ..
cmake --build .
Running Tests
Set the location to the build
folder and run:
ctest -VV
Running the Main Program
Set the location to the build/bin
folder and run:
./cpp-sample
Building with Docker
Prerequisites
- Install Docker.
Building
Set the location to the project folder and run:
docker image build . -t <image>
<image>
should be replaced with a custom Docker image name.
Running Tests
docker container run <image> ctest --test-dir .. -VV
Running the Main Program
docker container run <image>
Structure
.
βββ .github
β βββ workflows
β βββ build-test.yaml
βββ cmake
β βββ hello.cmake
βββ docs
β βββ badges
β βββ C++.svg
β βββ Linux.svg
β βββ Made-with-CMake.svg
β βββ Made-with-Docker.svg
βββ include
β βββ foo
β βββ foo.h
βββ src
β βββ foo
β β βββ CMakeLists.txt
β β βββ foo.cpp
β β βββ private_foo_test.cpp
β β βββ private_foo.cpp
β β βββ private_foo.h
β βββ CMakeLists.txt
β βββ main.cpp
βββ tests
β βββ CMakeLists.txt
β βββ foo_test.cpp
βββ .clang-format
βββ .gitignore
βββ CITATION.cff
βββ CMakeLists.txt
βββ Dockerfile
βββ README.md