A Modern C++ Package Manager and Build System
Quick Start β’ Features β’ Installation β’ Documentation β’ Contributing
scrap is a modern development tool for C++ that brings the simplicity and power of Rust's Cargo to the C++ ecosystem. It provides a unified interface for project management, dependency handling, and build orchestration - all without the traditional complexity of C++ development.
C++ development has traditionally suffered from:
- π§ Complex build systems - CMake, Make, Bazel, Meson... each with its own learning curve
- π¦ No standard package manager - Unlike Rust, Go, or Node.js, C++ lacks a unified ecosystem
- π₯οΈ System-dependent toolchains - "It works on my machine" is too common
- π High barrier to entry - Setting up a C++ project shouldn't require a PhD
scrap solves these problems by providing:
- π Zero-configuration project setup - Get started in seconds, not hours
- π Standardized project structure - Convention over configuration
- π Reproducible builds - Same toolchain, same results, everywhere
- π¦ Modern package management - GitHub-based ecosystem for sharing libraries
- π οΈ Integrated toolchain management - No more system dependency hell
# Create a new C++ application
scrap new my-app
# Create a new C++ library
scrap new my-lib --type=lib
# Build your project
cd my-app
scrap build
# Run your application
scrap run
# Clean build artifacts
scrap cleanThat's it! No CMakeLists.txt, no Makefiles, no complex setup. scrap handles everything.
Projects are configured with a simple scrap.toml file:
[package]
name = "my-app"
version = "0.1.0"
type = "app"
std = "23"
[[bin]]
name = "my-app"
src = "src/main.cpp"
[dependencies]
fmt = "10.2.1"
boost = { version = "1.84.0", features = ["filesystem", "asio"] }Get started quickly with built-in templates:
# Use the default app template
scrap new my-project
# Use a specific template
scrap new my-game --template=game-engine
# Use a GitHub template
scrap new my-tool --template=github:user/template-repo# Install a specific toolchain
scrap toolchain install llvm@18.0.0
# List available toolchains
scrap toolchain list
# Select a toolchain for your project
scrap toolchain select gcc@13.2.0# Add a dependency
scrap add fmt
# Search for packages
scrap search boost
# Update dependencies
scrap updatescrap is in early alpha development (v0.0.1). Currently implemented:
β Core Features
- Project creation (
scrap new) - Template system with variable substitution
- Basic command structure (build, run, clean)
- Configuration file parsing (
scrap.toml)
π§ In Progress
- Git-based template repository integration
- Build system implementation
- Toolchain management
π Planned
- Package registry and dependency management
- Cross-compilation support
- IDE integrations
- CI/CD templates
- C++23 compatible compiler (GCC 13+, Clang 16+, MSVC 2022+)
- CMake 3.20 or higher
- Git
# Clone the repository
git clone https://github.com/skipbit/scrap.git
cd scrap
# Configure and build
cmake -S . -B build/release -DCMAKE_BUILD_TYPE=Release
cmake --build build/release --parallel
# The executable will be at build/release/bin/scrapsudo cp build/release/bin/scrap /usr/local/bin/Detailed documentation is being developed. For now:
scrap is building a comprehensive C++ ecosystem:
- scrap-templates - Official project templates
- scrap-packages (Coming Soon) - Package registry
- scrap-toolchains (Coming Soon) - Toolchain definitions
Our goal is to create a Homebrew-like ecosystem for C++ development, where:
- Libraries are easily discoverable and installable
- Toolchains are managed independently from the system
- Projects are reproducible across different environments
- The community can easily contribute and share packages
We welcome contributions! scrap is built with:
- Clean Architecture - Domain-driven design with clear separation of concerns
- Modern C++23 - Leveraging the latest language features
- SOLID Principles - Extensible and maintainable codebase
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Follow our coding style guide
- Commit your changes
- Push to your branch
- Open a Pull Request
# Clone with submodules
git clone --recursive https://github.com/skipbit/scrap.git
# Build in debug mode
cmake -S . -B build/debug -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON
cmake --build build/debug --parallel
# Run tests
cmake --build build/debug --target test
# Or run tests directly
./build/debug/test/scrap_testThe project uses Catch2 v3.7.1 for unit testing. Tests are automatically built when BUILD_TESTS=ON.
# Build and run all tests
cmake --build build/debug --target test
# Run tests with verbose output
ctest --test-dir build/debug --output-on-failure --verbose
# Run specific test executable
./build/debug/test/scrap_test
# Release build testing
cmake -S . -B build/release -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON
cmake --build build/release --target testTest Structure:
test/unit/- Unit tests for individual componentstest/helpers/- Test utilities (TestPresenter, FileSystemHelper)test/fixtures/- Test data and mock templates
- β Command structure and template system
- π§ Configuration management
- π§ Basic build system
- β³ Toolchain management
- β³ Full build system implementation
- β³ Dependency resolution
- β³ Package registry
- β³ Binary package distribution
- β³ Package publishing tools
- β³ Cross-compilation
- β³ IDE integrations
- β³ CI/CD templates
- β³ SBOM generation
scrap follows these core principles:
- Convention over Configuration - Sensible defaults that just work
- Reproducible Builds - Same input, same output, everywhere
- Modern C++ First - Built for C++17/20/23, not C++98
- Community Driven - Open source, open development
- Developer Experience - Making C++ development enjoyable
scrap is MIT licensed. See LICENSE for details.
scrap is inspired by:
- Cargo - Rust's excellent package manager
- Homebrew - The missing package manager for macOS
- Poetry - Python's modern dependency management
Special thanks to all contributors and the C++ community for feedback and support.
- GitHub Issues: Report bugs or request features
- Discussions: Join the conversation
Made with β€οΈ for the C++ Community