CForge – A Modern C++ Build System

Introduction CForge replaces complex CMake scripts with a single cforge.toml file that defines targets, build options, and dependencies in a clear, human-readable format. It was created by Chase Sunstrom to address pain points voiced by C/C++ developers on Reddit and to provide a Cargo-like experience for C++ projects. Why I Created CForge Early feedback on Reddit channels such as r/cpp and r/gamedev highlighted frustration with verbose CMake configurations and fragmented dependency workflows. Many developers expressed interest in a tool that integrates dependency fetching via vcpkg and Git while automating workspace handling. Contributions and issue discussions on GitHub further demonstrated the need for streamlined cross-platform builds and better IDE support. Key Features TOML-Based Configuration Define your entire project, from source directories to build flags, in cforge.toml without writing CMake scripts by hand: [project] name = "myproject" version = "0.1.0" cpp_standard = "17" binary_type = "executable" Dependency Management Native integration with vcpkg, Git repositories, and custom scripts ensures dependencies are resolved and configured automatically. Cross-Platform Builds Support for Windows, macOS, and Linux with seamless configuration of compiler toolchains. Cross-Compilation Easily target platforms like Android, iOS, Raspberry Pi, and WebAssembly with minimal extra configuration. Workspaces Manage multiple interdependent projects within a single repository, with automatic inter-project dependency resolution. IDE Integration Generate project files for VS Code, CLion, Xcode, and Visual Studio with a single command: cforge ide vs cforge ide clion Testing & Diagnostics Built-in support for cforge-test and enhanced compiler diagnostics to speed up debugging. Scripts & Hooks Define custom pre-build and post-build scripts to automate tasks at various stages of the build lifecycle. Getting Started Installation Clone and bootstrap from source: git clone https://github.com/ChaseSunstrom/cforge.git bash scripts/bootstrap.sh # Linux/macOS .\scripts\bootstrap.ps1 # Windows PowerShell Requires CMake ≥ 3.15 and a C/C++ compiler (GCC, Clang, or MSVC). Quick Start Initialize and build a new project in seconds: cforge init cforge build cforge run This creates a cforge.toml, src/, include/, and build/ directory for a “Hello, World!” application. Advanced Topics Workspaces Enable workspace mode in cforge.workspace.toml to coordinate multiple related projects in one repository. Use workspace-level dependency overrides and shared build configurations to reduce duplication. Cross-Compilation Set the [cross_compile] section in cforge.toml to produce binaries for non-host targets (e.g., WebAssembly or embedded Linux). Recent Releases & Roadmap v2.0.0-beta (May 11, 2025): Engine rewrite from Rust to C/C++ for lower overhead and tighter toolchain integration. v2.1.0-beta (May 16, 2025): Adds advanced Visual Studio solution generation and per-project workspace overrides. Upcoming v1.0.0: Planned stable release with PCH optimizations, plugin system, and language server support. Community & Contribution Join discussions on GitHub Discussions, file issues, and submit pull requests at the CForge repository. Engage with fellow developers on Reddit at r/cpp, r/gamedev, and r/Cplusplus. Conclusion CForge offers a declarative, streamlined approach to C/C++ build management, combining the flexibility of TOML with the robustness of CMake and vcpkg. Whether crafting simple libraries or orchestrating complex workspaces, CForge accelerates development and reduces configuration overhead. Try it today and become part of the growing CForge community!

May 16, 2025 - 16:54
 0
CForge – A Modern C++ Build System

Introduction

CForge replaces complex CMake scripts with a single cforge.toml file that defines targets, build options, and dependencies in a clear, human-readable format. It was created by Chase Sunstrom to address pain points voiced by C/C++ developers on Reddit and to provide a Cargo-like experience for C++ projects.

Why I Created CForge

Early feedback on Reddit channels such as r/cpp and r/gamedev highlighted frustration with verbose CMake configurations and fragmented dependency workflows. Many developers expressed interest in a tool that integrates dependency fetching via vcpkg and Git while automating workspace handling. Contributions and issue discussions on GitHub further demonstrated the need for streamlined cross-platform builds and better IDE support.

Key Features

TOML-Based Configuration

Define your entire project, from source directories to build flags, in cforge.toml without writing CMake scripts by hand:

[project]
name = "myproject"
version = "0.1.0"
cpp_standard = "17"
binary_type = "executable"

Dependency Management

Native integration with vcpkg, Git repositories, and custom scripts ensures dependencies are resolved and configured automatically.

Cross-Platform Builds

Support for Windows, macOS, and Linux with seamless configuration of compiler toolchains.

Cross-Compilation

Easily target platforms like Android, iOS, Raspberry Pi, and WebAssembly with minimal extra configuration.

Workspaces

Manage multiple interdependent projects within a single repository, with automatic inter-project dependency resolution.

IDE Integration

Generate project files for VS Code, CLion, Xcode, and Visual Studio with a single command:

cforge ide vs
cforge ide clion

Testing & Diagnostics

Built-in support for cforge-test and enhanced compiler diagnostics to speed up debugging.

Scripts & Hooks

Define custom pre-build and post-build scripts to automate tasks at various stages of the build lifecycle.

Getting Started

Installation

Clone and bootstrap from source:

git clone https://github.com/ChaseSunstrom/cforge.git
bash scripts/bootstrap.sh       # Linux/macOS
.\scripts\bootstrap.ps1         # Windows PowerShell

Requires CMake ≥ 3.15 and a C/C++ compiler (GCC, Clang, or MSVC).

Quick Start

Initialize and build a new project in seconds:

cforge init
cforge build
cforge run

This creates a cforge.toml, src/, include/, and build/ directory for a “Hello, World!” application.

Advanced Topics

Workspaces

Enable workspace mode in cforge.workspace.toml to coordinate multiple related projects in one repository. Use workspace-level dependency overrides and shared build configurations to reduce duplication.

Cross-Compilation

Set the [cross_compile] section in cforge.toml to produce binaries for non-host targets (e.g., WebAssembly or embedded Linux).

Recent Releases & Roadmap

  • v2.0.0-beta (May 11, 2025): Engine rewrite from Rust to C/C++ for lower overhead and tighter toolchain integration.
  • v2.1.0-beta (May 16, 2025): Adds advanced Visual Studio solution generation and per-project workspace overrides.
  • Upcoming v1.0.0: Planned stable release with PCH optimizations, plugin system, and language server support.

Community & Contribution

Join discussions on GitHub Discussions, file issues, and submit pull requests at the CForge repository. Engage with fellow developers on Reddit at r/cpp, r/gamedev, and r/Cplusplus.

Conclusion

CForge offers a declarative, streamlined approach to C/C++ build management, combining the flexibility of TOML with the robustness of CMake and vcpkg. Whether crafting simple libraries or orchestrating complex workspaces, CForge accelerates development and reduces configuration overhead. Try it today and become part of the growing CForge community!