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