There are too many ways to start, build, and cross-build a C++ project. Unlike Rust’s cargo or Go’s go tool, C++ lacks a unified toolchain to easily initialize a project, run tests, or manage builds. Dependency management is fragmented across options like vcpkg, Meson, and Bazel, none of which save you from the burden of manual configuration.
Cpx aims to provide an opinionated template to jumpstart your C++ projects while retaining the flexibility to choose your preferred build system, testing framework, and benchmarking library. Once your project is created, you shouldn’t need to memorize different commands for every task. Cpx unifies these workflows into simple, intuitive commands: cpx build, cpx run, cpx test, and cpx bench.
Unified Workflow
While commands like vcpkg add port spdlog aren’t inherently difficult, remembering context-specific syntax for every build system is a friction point.
Cpx abstracts this away. Whether you’re using CMake, Meson, or Bazel under the hood, the commands you type remain the same:
cpx build # Build the project
cpx run # Run the main executable
cpx test # Run all tests
cpx bench # Run benchmarks
cpx add spdlog # Add a dependency
Opinionated but Flexible
Cpx comes with sensible defaults. When you run cpx new my-project, you get a ready-to-compile project structure with CMake, GoogleTest, and Google Benchmark configured out of the box.
But if you prefer Meson over CMake, or Catch2 over GoogleTest, you can easily switch. The goal is to reduce boilerplate, not enforce a particular stack.
Cross-Compilation Made Simple
One of the most painful aspects of C++ development is cross-compiling for different platforms. Cpx integrates with Docker to make this seamless:
cpx add-target linux-arm64
cpx build --target linux-arm64
No manual toolchain setup. No fiddling with sysroots. Just specify the target and build.
What’s Next
Cpx is still in active development. The roadmap includes better IDE integration, support for more build systems, and a package registry for sharing project templates.
If you’re tired of the fragmented C++ tooling ecosystem, give cpx a try. Check out the GitHub repository to get started.