How to migrate from CMake to Wefti
Install Wefti beside CMake, run wefti verify on your project, and switch when the results match.
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.github.io/wefti/install.sh | bash
wefti --version
cmake --version
On Windows, run irm https://wefti.github.io/wefti/install.ps1 | iex.
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.
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.
5. Keep a rollback path
Your project files need no change. Configure a fresh build directory after you switch back.
curl -fsSL https://wefti.github.io/wefti/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.
Verified v0.3.0 parity and limits
Strict parity on unseen repositories is lower, so run wefti verify first.
| Test set | Result |
|---|---|
| Tests/RunCMake | 27,953 / 27,953 cases across 1,099 / 1,099 suites on macOS, Linux, and Windows |
| vcpkg | 1,535 / 1,535 scored ports across 64 / 64 shards |
| Large C++ projects | 10 / 10 passed strict L1 configure and L2 Ninja dry-run parity |
| Conan | 2 / 2 scenarios |
| Sealed holdout, configure usability | 74 / 75 eligible repositories (98.67%) |
| Sealed holdout, strict L1 parity | 48 / 74 repositories (64.86%) |
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.3.0, Wefti matched CMake 4.5.1 configure results on 1,535 / 1,535 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.



