Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tessapower/template-cmake-project
A template CMake project for C++.
https://github.com/tessapower/template-cmake-project
cmake cpp template
Last synced: about 7 hours ago
JSON representation
A template CMake project for C++.
- Host: GitHub
- URL: https://github.com/tessapower/template-cmake-project
- Owner: tessapower
- Created: 2021-10-13T21:03:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-02T09:36:28.000Z (almost 2 years ago)
- Last Synced: 2023-08-17T04:52:37.337Z (over 1 year ago)
- Topics: cmake, cpp, template
- Language: CMake
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Template CMake Project
This is my standard template CMake project to use for C++ projects. I created
this so I don't need to always start from scratch each time I create a new C++
project. This template consists of a library `my_lib` and a basic entry point,
`my_app.cpp`, that makes use of it. All functionality is contained within
`my_lib` to make it easy to test. Tests for `my_lib` functionality are found in
the `tests` directory.### Directory Structure
```text
.
├── app
│ ├── CMakeLists.txt
│ └── my_app.cpp
├── cmake-build-debug
├── CMakeLists.txt
├── include
│ └── my_lib
│ └── my_lib.h
├── README.md
├── src
│ ├── CMakeLists.txt
│ └── my_lib
│ └── my_lib.cpp
└── tests
├── addition_tests.cpp
├── CMakeLists.txt
└── subtraction_tests.cpp
```Each directory (except for `include`) contains a `CMakeLists.txt` that takes
care of structuring and linking its files together to be used by the rest of
the project. The `CMakeLists.txt` in the root directory takes care of including
these subdirectories as part of the project.The structure and layout was derived from
"[An Introduction to Modern CMake](https://cliutils.gitlab.io/modern-cmake/)".- CMake Version: `3.25`
- C++ Standard: `C++20`
- Testing Framework: `GoogleTest`### Build Configurations
- `my_app`: run the main program
- `All Ctest`: run the tests for `my_lib` (using _GoogleTest_)
- Most of the other build configurations are not necessary for small projects,
but are created by CTest by default.Feel free to use :)