Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Latest commit

 

History

41 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cppup

codecov CI

A powerful and interactive C++ project generator written in Rust. It helps you quickly set up new C++ projects with modern best practices and your preferred configurations.

Features

  • 🎯 Interactive CLI with smart defaults
  • 🏗️ Multiple build systems (CMake, Make)
  • 📦 Package manager integration (Conan, Vcpkg)
  • ✅ Testing framework setup (doctest, Google Test, Catch2, Boost.Test)
  • 🔍 Code quality tools (clang-format, clang-tidy, cppcheck)
  • 📝 License management (MIT, Apache-2.0, GPL-3.0, BSD-3-Clause)
  • 🎨 Project templates (Executable, Library)
  • 🔄 Git initialization

Prerequisites

  • C++ compiler - clang or gcc
  • CMake or Make build system
  • Optional: Conan or Vcpkg package manager
  • Optional: clang-format, clang-tidy, or cppcheck for code quality tools

Building

cargo build

Development

Running Tests

cargo test

Code Coverage

Generate code coverage reports locally:

# Install cargo-tarpaulin
cargo install cargo-llvm-cov

# Print the coverage summary to stdout
cargo llvm-cov

# Open coverage report
cargo llvm-cov --open

Pre-commit Hooks

This project includes pre-commit hooks that run code formatting and linting checks before each commit. To install them:

./hooks/install-hooks.sh

The pre-commit hook will automatically:

  • Check code formatting with cargo fmt
  • Run linting checks with cargo clippy

If you need to commit without running the hooks (not recommended), use:

git commit --no-verify

Usage

Interactive Mode

Simply run:

cppup

Follow the interactive prompts to configure your project.

Non-Interactive Mode

Create a new executable project with specific settings:

cppup --name my-project \
      --description "My awesome C++ project" \
      --project-type executable \
      --build-system cmake \
      --cpp-standard 17 \
      --package-manager conan \
      --test-framework doctest \
      --license MIT \
      --quality-tools clang-format,clang-tidy \
      --non-interactive

Available Options

  • --name: Project name
  • --description: Project description
  • --project-type: executable or library
  • --build-system: cmake or make
  • --cpp-standard: 11, 14, 17, 20, or 23
  • --package-manager: none, conan, or vcpkg
  • --test-framework: none, doctest, gtest, catch2, or boosttest
  • --license: MIT, Apache-2.0, GPL-3.0, or BSD-3-Clause
  • --quality-tools: Comma-separated list of clang-format, clang-tidy, cppcheck
  • --non-interactive: Skip interactive prompts
  • --path: Output directory (default: current directory)
  • --git: Initialize git repository (default: true)

Project Structure

Generated project structure for an executable:

my-project/
├── src/
│   └── main.cpp
├── include/
├── assets/
├── tests/           # If testing is enabled
├── build/
├── CMakeLists.txt   # Or Makefile
├── .gitignore
├── LICENSE
└── README.md

For a library:

my-project/
├── src/
│   └── lib.cpp
├── include/
│   └── my-project.hpp
├── examples/
├── tests/           # If testing is enabled
├── build/
├── CMakeLists.txt   # Or Makefile
├── .gitignore
├── LICENSE
└── README.md

License

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

Author

Nauris Linde [email protected]

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.

Acknowledgments

About

No description or website provided.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages