A C++ project template on Ubuntu built with:
- Install GoogleTest.
- Install CMake.
Go to the project folder and run:
mkdir -p build
cd build
cmake ..
cmake --build .
Go to the build
folder and run:
ctest -VV
Go to the build/bin
folder and run:
./cpp-sample
- Install Docker.
Go to the project folder and run the following command to create an image:
docker image build . -t <image>
<image>
should be replaced with a custom Docker image name.
docker container run <image> ctest --test-dir .. -VV
docker container run <image>
Currently Makefile
does not support GoogleTest.
Go to the project folder and run:
make
Go to the build
folder and run:
./cpp-sample
.
βββ .github
β βββ workflows
β βββ cmake-gtest.yaml
β βββ docker.yaml
β βββ make.yaml
βββ cmake
β βββ hello.cmake
βββ docs
β βββ badges
β βββ C++.svg
β βββ Linux.svg
β βββ Made-with-CMake.svg
β βββ Made-with-Make.svg
β βββ Made-with-Docker.svg
β βββ Made-with-GitHub-Actions.svg
β βββ PowerShell.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
βββ Build-CMake.ps1
βββ CITATION.cff
βββ CMakeLists.txt
βββ Dockerfile
βββ Makefile
βββ README.md