CForge
A modern TOML-based build system for C/C++ with CMake & vcpkg integration.
CForge simplifies C/C++ project management with clean TOML configuration, Cargo-style output, and integrated developer tools - while leveraging the power of CMake under the hood.
Beta Software
This project is currently in BETA. Features may be incomplete, contain bugs, or change without notice.
Features
Build System
- Simple TOML Configuration - Replace complex CMakeLists.txt with readable TOML
- Portable Compiler Flags - Write once, works on MSVC, GCC, and Clang
- Cargo-Style Output - Beautiful colored output with build timing
- Multi-Platform - Windows, macOS, and Linux support
- Cross-Compilation - Android, iOS, Raspberry Pi, WebAssembly toolchains
- Workspaces - Manage monorepos with automatic dependency resolution
- Lock Files - Reproducible builds with exact dependency versions
Dependency Management
- vcpkg Integration - First-class support for vcpkg packages
- Conan Support - Integrate with Conan package manager
- Git Dependencies - Clone and build from Git repositories
- System Libraries - Link against system-installed libraries
- Dependency Visualization - View dependency tree with
cforge deps tree
Developer Tools
- Code Formatting -
cforge fmtwith clang-format integration - Static Analysis -
cforge lintwith clang-tidy integration - File Watching -
cforge watchauto-rebuilds on file changes - Documentation -
cforge docgenerates docs with Doxygen - Benchmarking -
cforge benchruns Google Benchmark and others - Code Templates -
cforge newgenerates classes, headers, tests - Shell Completions - Bash, Zsh, PowerShell, and Fish support
IDE Integration
- VS Code - Tasks, launch configs, and settings
- CLion - CMake integration with run configurations
- Visual Studio - Solution and project files
- Xcode - macOS and iOS project generation
Enhanced Diagnostics
- Colored Output - Clear visual distinction for errors and warnings
- Error Context - Shows relevant code snippets
- Fix Suggestions - Common fixes for linker and compiler errors
- Template Error Parsing - Simplified template instantiation errors
Quick Example
cforge.toml:
[project]
name = "my_app"
version = "1.0.0"
binary_type = "executable"
cpp_standard = "17"
[build.config.debug]
optimize = "debug"
debug_info = true
warnings = "all"
[build.config.release]
optimize = "speed"
lto = true
[dependencies]
fmt = "11.1.4"
spdlog = "1.12.0"
Build & Run:
$ cforge build
Compiling my_app v1.0.0
Compiling src/main.cpp
Finished Debug target(s) in 1.23s
$ cforge run
Running my_app
Hello, World!
Getting Started
- Installation - Install CForge on your system
- Quick Start - Create your first project
- Command Reference - Full command documentation
Requirements
- CMake 3.16 or later
- C++ Compiler - MSVC, GCC, or Clang
- vcpkg (optional) - For vcpkg dependency management