How to migrate from CMake to Wefti
Install Wefti beside CMake, run wefti verify on your project, and switch when the results match.
Read the replacement guide for scope and known limits. Use the installation guide to obtain the same release for each comparison.
What stays the same
CMakeLists.txt- Presets v13
- Toolchain files
-Ccache scriptsCMakeCache.txt- CMake 4.5.1
Modules/ - Your generator
Migrate in five steps
Steps 1 to 3 keep CMake as your build tool.
- Install Wefti beside CMake. Skip the aliases, so your
cmakedoes not change. - Verify your project. Compare configure results with CMake 4.5.1.
- Audit build tree differences. Diff targets, flags, links, and cache.
- Choose native or compatibility mode. Use
weftifor speed, or aliascmakefor exact output. - Keep a rollback path. Remove Wefti from
PATHor uninstall it.
1. Install Wefti beside CMake
Without --alias-cmake, your system cmake stays first on PATH.
curl -fsSL https://wefti.dev/install.sh | bash -s -- --version 0.4.0
wefti --version
cmake --version
On Windows, download the PowerShell installer and run .\install.ps1 -Version 0.4.0.
2. Verify your project
It runs your project twice in a private copy and never writes to your tree.
wefti verify --oracle /path/to/cmake-4.5.1 -- -S . -G Ninja
wefti verify --json --oracle /path/to/cmake-4.5.1 -- -S . -G Ninja > verify.json
Exit code 0 means parity, 1 means a difference, and 2 means incomplete evidence.
3. Audit build tree differences
Run --prepare first so both trees record exact compile and link data.
mkdir -p build-cmake build-wefti
wefti diff-config --prepare build-cmake build-wefti
cmake -S . -B build-cmake -G Ninja
wefti -S . -B build-wefti -G Ninja
wefti diff-config build-cmake build-wefti
Exit codes match wefti verify. Add --json for a machine-readable report.
4. Choose native or compatibility mode
- Native mode (
wefti) - Adds the probe cache, incremental replay, and tools such as
explain,lint, andfmt. - Compatibility mode (
cmake,ctest,cpack,ccmake) - Matches CMake 4.5.1 flags, output, and exit codes. Install with
--alias-cmakeor setWEFTI_ORACLE_MODE=1. SetWEFTI_PROBE_CACHE=onto add the shared probe cache without changing any output.WEFTI_ORACLE_MODE=1keeps the cache off.
wefti --preset release
wefti -S . -B build -G Ninja -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
WEFTI_ORACLE_MODE=1 wefti -S . -B build-make -G "Unix Makefiles"
Use compatibility mode for scripts that parse CMake output or exit codes.
Use the v0.4.0 commands
Run wefti env --json to inspect the detected toolchain environment. For a Ninja build, run wefti build build-wefti to use the built-in Ninja 1.13.2 executor.
Use wefti modernize --diff to review proposed changes to CMake files. By default, wefti modernize --apply checks the original and edited configurations with wefti diff-config in a staged copy before it writes the edits.
Use wefti sbom to generate a software bill of materials from the configured build. Use wefti audit to check dependency declarations, pins, and cached sources offline.
wefti env --json
wefti build build-wefti
wefti modernize --diff
wefti sbom build-wefti --output sbom.json
wefti audit build-wefti --json
5. Keep a rollback path
Your project files need no change. Configure a fresh build directory after you switch back.
curl -fsSL https://wefti.dev/install.sh | bash -s -- --uninstall
cmake --version
cmake --fresh -S . -B build -G Ninja
On Windows, run install.ps1 -Uninstall. Add --prefix if you installed to another directory.
Compatibility results and limits
The sealed holdout contained 240 repositories. Strict L1 parity checks configure diagnostics, cache entries, the CMake File API codemodel, and Ninja graph edges. Run wefti verify to check your project.
| Test set | Wefti release | Result |
|---|---|---|
Tests/RunCMake | v0.4.0 | 27,953 / 27,953 cases (100.00%) across 1,099 / 1,099 targeted suites on macOS, Linux, and Windows |
| vcpkg | v0.4.0 | 1,518 / 1,518 scored CMake ports matched (100.00%) across 64 / 64 shards |
| Large C++ projects | v0.4.0 | 10 / 10 passed strict L1 configure parity. 10 / 10 passed L2 Ninja dry-run parity. |
| Conan | v0.4.0 | 2 / 2 scenarios passed |
| Sealed holdout, configure usability | v0.4.0 | 76 / 78 eligible repositories (97.44%). Zero find-module failures. |
| Sealed holdout, strict L1 parity | v0.4.0 | 72 / 77 eligible repositories (93.51%). The v0.3.1 strict pass rate was 68.92%. |
Wefti leaves out cmake-gui, Visual Studio 2015 to 2019, legacy extra generators, and MinGW and MSYS Makefiles. Keep upstream CMake for those.
Frequently asked questions
Do I need to rewrite CMakeLists.txt to migrate to Wefti?
No. Wefti reads your existing CMakeLists.txt files, CMake Presets v13, toolchain files, and CMakeCache.txt. The migration changes only the command that runs configure.
Can I install Wefti without replacing my system cmake?
Yes. The installer adds the cmake, ctest, cpack, and ccmake links only when you pass --alias-cmake on macOS or Linux, or -AliasCmake on Windows. Without that option, the wefti command sits beside your existing cmake.
How do I check that Wefti produces the same build as CMake?
Run wefti verify --oracle /path/to/cmake-4.5.1 -- -S . -G Ninja. It configures staged copies of your project with both tools and compares the File API codemodel, CMakeCache.txt, compile_commands.json, and Ninja dry-run output. Exit code 0 means parity.
Does Wefti work with vcpkg, Conan, and CMake presets?
Yes. In v0.4.0, Wefti matched CMake 4.5.1 configure results on 1,518 / 1,518 scored vcpkg ports and passed 2 / 2 Conan scenarios. It reads CMake Presets schema v13.
How do I roll back from Wefti to CMake?
Remove the Wefti install bin directory from PATH, run install.sh --uninstall on macOS or Linux, or download install.ps1 and run it with -Uninstall on Windows. Then configure a new build directory with CMake. Your project files need no change.
When should I keep upstream CMake?
Keep upstream CMake if you need cmake-gui, Visual Studio 14 to 16 generators, a legacy extra generator, or a MinGW or MSYS Makefile generator. Keep it also if wefti verify reports a difference that affects your build.