Skip to content

geugenm/template-cpp-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸš€ Modern C++ Project Template

C++ Standard CMake License

Build Matrix Performance Architecture

Documentation Testing Package Manager

Containerization CI/CD IDE Support

🌟 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

# Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Dependencies
brew install cmake llvm doxygen

πŸͺŸ Windows

# 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

sudo apt update
sudo apt install cmake g++ doxygen

Fedora

sudo dnf check-update
sudo dnf install cmake gcc-c++ doxygen

πŸ› οΈ Build & Deployment

Build Project

cmake --preset=gcc .
cd build/release
cmake --build . --config gcc

Run Tests

cd build/gcc
ctest --output-on-failure

Docker Build

docker build -t my-image -f docker/<desired_os>.Dockerfile .

πŸ“š Documentation

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

πŸ™ Acknowledgments

Thanks to CMake, CTest, and the open-source community.

About

Just a template for future projects in c++

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published