caxe (cx) 🪓
caxe (pronounced "c-axe") is a modern project manager for C and C++ designed to cut through the complexity of legacy build systems.
It provides a unified workflow for scaffolding, building, testing, formatting, and managing dependencies—giving C/C++ developers the modern experience they deserve.
Zero Configuration. Lightning Fast. Batteries Included.
✨ Features
- ⚡ Zero Config Start: Create a Hello World C/C++ project in seconds.
- 📦 Smart Dependency Management:
- Git Libraries: Automatically downloads & builds libraries from GitHub.
- System Packages: Native support for
pkg-config(e.g., GTK, OpenSSL).
- 🎨 Code Formatting: Built-in
cx fmtcommand to keep your code clean (viaclang-format). - 🚀 Parallel & Incremental Builds: Lock-free parallel compilation engine for maximum speed.
- 💾 Global Caching: Libraries are downloaded once and shared across all projects.
- 👁️ Watch Mode: Automatically recompiles and runs your project when you save a file.
- 🛠️ Flexible Configuration: Custom binary names, environment variable support (
CC,CXX), and build scripts.
📦 Installation
Option 1: Download Binary (Recommended)
No Rust or Cargo required. Download the latest release for your OS:
- Windows: Download cx-windows.exe
- Linux: Download cx-linux
- macOS: Download cx-macos
Add the binary to your system PATH to run it from anywhere.
Option 2: Install via Cargo
If you are a Rust developer:
🚀 Usage
1. Create a new project
Start with a default console app, or use a template.
# Default (Hello World)
# Web Server (cpp-httplib)
# Raylib Game Config
2. Manage Dependencies
Define dependencies in cx.toml. caxe supports both Git repositories and System Packages (pkg-config).
[]
# 1. Git Dependency (Auto download & link)
= "https://github.com/nlohmann/json.git"
# 2. System Dependency (Uses pkg-config)
= { = "gtk4" }
= { = "openssl" }
3. Build & Run
# Compile and Run
# Run with optimizations (Release mode)
# Format code (Requires clang-format)
4. Watch mode (Auto-reload)
Coding without manually recompiling every time.
⚙️ Configuration (cx.toml)
Example of a full configuration file:
[]
= "my-awesome-app"
= "0.1.0"
= "c++20"
[]
# Optional: Override output binary name (default is package name)
= "app"
# Optional: Custom flags
= ["-O2", "-Wall", "-Wextra"]
= ["pthread", "m"]
[]
= "https://github.com/fmtlib/fmt.git"
= { = "sdl2" }
[]
= "echo Compiling..."
= "echo Done!"
🛠️ Advanced
Environment Variables
caxe respects standard environment variables for compiler selection:
# Linux/Mac
CXX=clang++-14
# Windows (PowerShell)
$env:CXX="g++";
Unit Testing
Create a tests/ directory and add .cpp files. caxe will compile and run them automatically.
📝 License
MIT