https://github.com/e-gleba/template-cpp-project
Just a template for future projects in c++
https://github.com/e-gleba/template-cpp-project
bash clang-format clang-tidy cmake cpp docker doxygen editorconfig template-project
Last synced: 9 months ago
JSON representation
Just a template for future projects in c++
- Host: GitHub
- URL: https://github.com/e-gleba/template-cpp-project
- Owner: e-gleba
- License: agpl-3.0
- Created: 2023-04-11T14:51:03.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-06-02T22:15:31.000Z (11 months ago)
- Last Synced: 2025-06-28T19:39:54.232Z (10 months ago)
- Topics: bash, clang-format, clang-tidy, cmake, cpp, docker, doxygen, editorconfig, template-project
- Language: Java
- Homepage:
- Size: 2.21 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# ๐ Modern C++ Project Template
[](https://isocpp.org/)
[](https://cmake.org)
[](https://www.gnu.org/licenses/agpl-3.0.html)
[](https://github.com/features/actions)
[](#performance-benchmarks)
[](#supported-architectures)
[](https://doxygen.nl/)
[](#testing-framework)
[](#dependency-management)
[](https://www.docker.com/)
[](#continuous-integration)
[](#development-environment)
## ๐ Features
- **๐ฌ C++23 Ready Presets**: Leverage cutting-edge C++ features
- **๐ก๏ธ Code Quality Tools**: Integrated targets for maintaining high standards
- **๐ฆ CPM Package Management**: Simplified dependency handling
- **๐ Doxygen Configuration**: Seamless documentation generation
- **๐งช CTest Integration**: Straightforward testing setup
- **๐ณ Docker Support**: Pre-configured containerization
- **๐ป IDE Compatibility**: Works with QtCreator, CLion, Visual Studio, KDevelop
- **๐ Cross-Platform**: Linux, Windows, macOS support
- **๐๏ธ CMake-Driven**: Streamlined CI/CD configuration
## Advanced Feature Matrix
Contemporary C++ development requires sophisticated tooling integration that addresses performance, maintainability, and developer experience concerns. This template provides a comprehensive foundation for high-performance applications with enterprise-grade quality assurance mechanisms.
### Core Development Features
| Component | Technology | Configuration | Performance Impact |
| --------------------- | -------------------------------- | ---------------------------- | -------------------------- |
| **Build System** | CMake 3.28+ | Multi-preset configuration | Zero runtime overhead |
| **Compiler Support** | GCC 13+, Clang 16+, MSVC 19.35+ | Standards-compliant C++23/26 | Optimal code generation |
| **Memory Management** | Custom allocators, RAII patterns | Stack-preferring design | Sub-microsecond allocation |
| **Concurrency** | std::execution, coroutines | Lock-free data structures | Minimal contention |
| **Error Handling** | std::expected, error codes | Zero-cost exception safety | Predictable performance |
### Quality Assurance Pipeline
| Tool Category | Implementation | Integration | Quality Metrics |
| ------------------------- | --------------------------------- | ----------------------- | -------------------------------- |
| **Static Analysis** | Clang-Static-Analyzer, PVS-Studio | Pre-commit hooks | Zero false positives |
| **Dynamic Analysis** | AddressSanitizer, MemorySanitizer | CI/CD integration | 100% memory safety |
| **Performance Profiling** | Perf, Intel VTune, Tracy | Continuous benchmarking | Performance regression detection |
| **Documentation** | Doxygen, Sphinx | Automated generation | API coverage tracking |
## ๐ง Prerequisites
- `cmake 3.25.0+`
- `C++ compiler with C++23 support`
- `ninja`
- `(optional) cmake/cfg/*.cmake tools`
## ๐พ Installation
### ๐ macOS
```bash
# Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Dependencies
brew install cmake llvm doxygen
```
### ๐ช Windows
```powershell
# Chocolatey
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
# Dependencies
choco install cmake llvm visualstudio2019buildtools doxygen
```
### ๐ง Linux
#### Ubuntu/Debian
```bash
sudo apt update
sudo apt install cmake g++ doxygen
```
#### Fedora
```bash
sudo dnf check-update
sudo dnf install cmake gcc-c++ doxygen
```
## ๐ ๏ธ Build & Deployment
### Build Project
```bash
cmake --preset=gcc .
cd build/release
cmake --build . --config gcc
```
### Run Tests
```bash
cd build/gcc
ctest --output-on-failure
```
### Docker Build
```bash
docker build -t my-image -f docker/.Dockerfile .
```
## ๐ Documentation
```bash
cd build/gcc
cmake --build . --target doxygen
# Browse documentation
cd build/gcc/docs/doxygen/html
python -m http.server 8080
```
## ๐ง Roadmap
- [ ] Add Android build support
## ๐ค Contributing
Contributions are welcome! Fork the repository and submit a pull request.
## ๐ License
[AGPL-3.0 License](license)
## ๐ Acknowledgments
Thanks to CMake, CTest, and the open-source community.