Drop-in CMake 4.5.1 in safe Rust.
One binary runs as cmake, ccmake, ctest, cpack, and rcmake-lsp.
$ curl -fsSL https://raw.githubusercontent.com/rcmake/rcmake/main/scripts/install.sh | bash
PS> irm https://raw.githubusercontent.com/rcmake/rcmake/main/scripts/install.ps1 | iex
$ git clone https://github.com/rcmake/rcmake.git $ cd rcmake && scripts/install.sh --from-source $ rcmake --version
$ curl -fsSL https://raw.githubusercontent.com/rcmake/rcmake/main/scripts/install.sh | bash -s -- --alias-cmake $ export PATH="$HOME/.local/bin:$PATH"
- -- The CXX compiler identification is AppleClang
- -- Detecting CXX compiler ABI info - done
- -- Configuring done
- -- Generating done
- -- Build files have been written to: <project>/build-2
- -- The CXX compiler identification is AppleClang
- -- Detecting CXX compiler ABI info - done
- -- Configuring done
- -- Generating done
- -- Build files have been written to: <project>/build-2
CMake has no cross-tree probe cache.
Speed
rcmake and CMake 4.5.1
| Feature | rcmake | CMake 4.5.1 |
|---|---|---|
cmake, ctest, and cpack commands |
yes | yes |
cmake -P scripts and cmake -E tools |
yes | yes |
Presets schema v13 and File API codemodel v2.12 |
yes | yes |
Policies CMP0066-CMP0226 with CMP0000-CMP0065 always NEW |
verification pending | yes |
--sarif-output diagnostics |
yes | yes |
CPack archives, DEB, RPM, Bundle, DragNDrop, productbuild, NSIS, NSIS64, WIX, and IFW |
yes | yes |
| Ninja, Unix Makefiles, NMake Makefiles, Xcode, and Visual Studio 2022 and 2026 generators | verification pending | yes |
ccmake TUI and --debugger DAP server |
yes | yes |
| Written in | Safe Rust with zstd and liblzma C codecs | C++ |
Archive owner in cmake -E tar and CPack |
uid 0, gid 0 | host owner |
| CUDA, HIP, and Swift targets | differslowering shipped, CI lacks GPU and Swift runners | yes |
| Probe cache and portable CI archives | shared across projects plus cache export and import |
per build tree |
| Incremental configure replay | replays unchanged subtrees including toolchains and presets | full reconfigure |
| Provenance, find diagnosis, and genex eval | rcmake explain (--flag, --dep, --find, --eval) |
--trace-format=json-v1, File API backtraces |
| Build comparison and parity verification | rcmake diff-config and isolated rcmake verify |
not available |
| Lossless formatter and 8-rule static linter | rcmake fmt, rcmake lint, .rcmake.toml, and LSP |
not available |
Multi-config compile_commands.json and drift detection |
--export-compile-commands and rcmake doctor -B |
not available |
--hermetic input audit and --fetch-lock |
yes | not available |
Built-in language server (rcmake-lsp) and WebAssembly |
yes | not available |
cmake-gui |
not available | yes |
| CodeBlocks, CodeLite, Eclipse CDT4, Kate, and Sublime Text 2 generators | not available | yes |
MinGW Makefiles and MSYS Makefiles |
not available | yes |
| Visual Studio 2015 to 2019 generators | not available | yes |
Inside a configure run
Eval
Runs commands and tracks variables, policies, and generator expressions.
- Syntax lexes and parses CMake language files.
- Eval runs commands and tracks variables, policies, and generator expressions.
- Resolve builds the target graph, usage requirements, and link order.
- Generate writes build.ninja, Unix Makefiles, NMake Makefiles, project.pbxproj, and .vcxproj files.
- Host abstracts OS access. NativeHost reads disk, environment, processes, and clock, while PureHost keeps files in memory for tests, editors, and wasm32.
Generators and languages
Generators
- Ninjabuild.ninja
- Ninja Multi-Configbuild.ninja build-<Config>.ninja
- Unix MakefilesMakefile
- NMake MakefilesMakefile
- Xcodeproject.pbxproj
- Visual Studio 17 2022 and 18 2026.sln .slnx .vcxproj
Languages
- C
- C++ with modules
- Objective-C
- Objective-C++
- Fortran
- CUDA
- HIP
- Swift
- ASM, MASM, NASM
- RC
- Qt
Common questions
Is rcmake a drop-in replacement for CMake 4.5.1?
Yes. A single rcmake binary inspects argv[0] to run as cmake, ccmake on macOS, Linux, and Windows, ctest, cpack, or rcmake-lsp. It reads existing CMakeLists.txt files, Presets v13, and CMakeCache.txt, then writes compatible build trees. Starting it as cmake, ccmake, ctest, or cpack, or setting RCMAKE_ORACLE_MODE=1, selects compatibility mode matching CMake 4.5.1.
Which generators, languages, and package managers does rcmake support?
rcmake generates Ninja, Ninja Multi-Config, Unix Makefiles, NMake Makefiles on Windows, Xcode on macOS, and Visual Studio 17 2022 and Visual Studio 18 2026 on Windows. It supports C, C++ with C++20 and C++23 named modules, Objective-C, Objective-C++, Fortran, CUDA, HIP, Swift, ASM, MASM, NASM, Windows RC, and Qt AUTOGEN. CPack covers archives, DEB, RPM, External, Bundle, DragNDrop, productbuild, NSIS, NSIS64, WIX v3 and v4, and IFW, alongside vcpkg, Conan, and FetchContent.
How do the probe cache, incremental replay, and drift checks work?
In native mode, rcmake caches verified compiler probes across projects after checking SHA-256 input digests, runs up to four literal compile probes in parallel, and shares caches across CI runners via rcmake cache export and import. Incremental replay reuses unchanged directory subtrees even with vcpkg toolchains, configure presets, -C scripts, and PreLoad.cmake by validating setup checkpoints. Native configures and rcmake doctor -B also detect stale CMakeCache.txt drift when compilers or toolchains change.
What native developer tools come with rcmake 0.2.2?
Opt-in native tools include rcmake explain for flags, definitions, includes, dependency paths, find_package rejections, and generator expressions, rcmake diff-config to compare any two cmake or rcmake build directories, rcmake fmt and 8-rule rcmake lint configured by .rcmake.toml, rcmake verify for side-by-side CMake 4.5.1 checks in an isolated companion binary, multi-config compile_commands.json export, --profile flame graphs, --hermetic audits, and --fetch-lock. Use rcmake explain --targets to list targets and rcmake preset show to inspect a resolved preset. Native configure can suggest a correction for an unused -D variable.
How do I install rcmake and alias cmake, ctest, cpack, and ccmake?
On Linux and macOS, run curl -fsSL https://raw.githubusercontent.com/rcmake/rcmake/main/scripts/install.sh | bash to install rcmake, rcmake-lsp, rcmake-verify, shell completions, and man pages into ~/.local. Append -s -- --alias-cmake after bash to symlink cmake, ctest, cpack, and ccmake. On Windows, run scripts/install.ps1 with -AliasCmake for aliases, or extract the x86_64-pc-windows-msvc ZIP archive from GitHub Releases. The release workflow builds Homebrew, Scoop, and WinGet manifests from the release checksums. Intel Macs build from source with scripts/install.sh --from-source.
What is intentionally different or not implemented in rcmake?
cmake-gui is not included. CPack installer generators invoke native host packagers, and rcmake verify requires a user-supplied CMake 4.5.1 binary. Legacy extra generators, older Makefile variants, and Visual Studio 14 to 16 are omitted. Tar and CPack archives record uid 0 and gid 0, and try_compile runs in-process.
Does rcmake contain any unsafe Rust or copied CMake C++ code?
rcmake contains no copied or translated CMake C++ code. The only project file with unsafe Rust is the audited Windows process interface in rcmake-winproc/src/ffi.rs. External Rust crates such as rustix and memchr use unsafe internally, and the native binary statically links zstd 1.5.7 and liblzma 5.8. Bundled CMake 4.5.1 Modules/, Templates/, and Help/ files stay under BSD-3-Clause, while Rust and Python code in this repository uses MIT OR Apache-2.0.
Can I run rcmake in WebAssembly or use an editor language server?
Yes. All OS access goes through rcmake_host::Host, so rcmake-api compiles with --no-default-features to wasm32-unknown-unknown and wasm32-wasip1 on PureHost, powering the zero-server browser playground. For editors, rcmake-lsp (or rcmake lsp) runs over stdio and provides hover with evaluated values, completion, go to definition, symbols, semantic tokens, quick fixes, lossless formatting, and all 8 static lint rules in VS Code, Neovim, Helix, Zed, Emacs, and CLion.