Skip to content

hun756/umath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

128 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“¦ Modern C++ Project Template

License C++ CMake

A modern, feature-rich, customizable C++20 project template

✨ Features

  • πŸ”„ Modern CMake (3.16+) setup
  • πŸš€ C++20 standard
  • πŸ“š Google Test integration
  • πŸ“ Comprehensive documentation structure
  • πŸ§ͺ Example code
  • πŸ› οΈ Out-of-the-box compiler warnings
  • πŸ” Code sanitizers
  • πŸ“Š Code coverage support
  • πŸ“‹ Static analysis support
  • πŸ”„ Continuous Integration ready
  • πŸ“¦ Package management support
  • 🚒 Installation and export targets

πŸ“‹ Requirements

  • CMake 3.16 or newer
  • C++20 compatible compiler
  • Git

πŸš€ Quick Start

# Clone the repository
git clone https://github.com/hun756/CPP-Starter-Template.git my-project
cd my-project

# Create build directory
mkdir build && cd build

# Configure
cmake ..

# Build
cmake --build .

# Run tests
ctest

# Run executable
./bin/cpp_project_template

πŸ“Š Project Structure

my-project/
β”œβ”€β”€ CMakeLists.txt         # Main CMake configuration
β”œβ”€β”€ cmake/                 # CMake modules and utilities
β”‚   β”œβ”€β”€ CompilerWarnings.cmake
β”‚   β”œβ”€β”€ Sanitizers.cmake
β”‚   β”œβ”€β”€ StaticAnalyzers.cmake
β”‚   β”œβ”€β”€ LTO.cmake
β”‚   β”œβ”€β”€ Packaging.cmake
β”‚   β”œβ”€β”€ FindGTest.cmake
β”‚   β”œβ”€β”€ FindGBenchmark.cmake  # Benchmark iΓ§in eklendi
β”‚   └── configs/           # Configuration templates
β”œβ”€β”€ include/               # Public header files
β”‚   └── myproject/
β”‚       β”œβ”€β”€ ModuleA.h
β”‚       └── ModuleB.h
β”œβ”€β”€ src/                   # Source files
β”‚   β”œβ”€β”€ ModuleA.cpp
β”‚   β”œβ”€β”€ ModuleB.cpp
β”‚   └── main.cpp
β”œβ”€β”€ test/                  # Test files
β”‚   β”œβ”€β”€ CMakeLists.txt
β”‚   β”œβ”€β”€ ModuleATest.cpp
β”‚   └── ModuleBTest.cpp
β”œβ”€β”€ bench/                 # Benchmark files
β”‚   β”œβ”€β”€ CMakeLists.txt
β”‚   β”œβ”€β”€ StringProcessorBench.cpp
β”‚   └── CalculatorBench.cpp
β”œβ”€β”€ examples/              # Example programs
β”‚   β”œβ”€β”€ CMakeLists.txt
β”‚   β”œβ”€β”€ example1.cpp
β”‚   └── example2.cpp
β”œβ”€β”€ docs/                  # Documentation
β”‚   β”œβ”€β”€ CMakeLists.txt
β”‚   └── Doxyfile.in
β”œβ”€β”€ .clang-format          # Formatting configuration
β”œβ”€β”€ .clang-tidy            # Static analysis configuration
β”œβ”€β”€ .gitignore
└── README.md

πŸ”§ Build Options

Option Default Description
BUILD_SHARED_LIBS OFF Build shared libraries
BUILD_EXAMPLES ON Build example programs
BUILD_TESTS ON Build tests
BUILD_BENCHMARKS ON Build benchmark programs
ENABLE_COVERAGE OFF Enable coverage reporting
ENABLE_SANITIZERS OFF Enable sanitizers in debug builds
ENABLE_PCH OFF Enable precompiled headers
ENABLE_LTO OFF Enable Link Time Optimization
ENABLE_CPPCHECK OFF Enable static analysis with cppcheck
ENABLE_CLANG_TIDY OFF Enable static analysis with clang-tidy

Example usage:

cmake .. -DBUILD_SHARED_LIBS=ON -DENABLE_SANITIZERS=ON

πŸ“š Documentation

Generate documentation with Doxygen:

cmake --build . --target docs

Create distributable packages:

cmake --build . --target package

This project can be easily integrated in other CMake projects:

find_package(cpp_project_template REQUIRED)
target_link_libraries(your_target PRIVATE cpp_project_template::cpp_project_template)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Commit your changes: git commit -am 'Add my feature'
  4. Push to the branch: git push origin feature/my-feature
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Math library for game development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published