WindowsLinux

Where Is the CMake Cache File?

CMake per-build CMakeCache.txt and the user package registry, covering where configure choices persist.

Last updated

CMake records configure choices in CMakeCache.txt at the root of each build directory. Installed package locations register separately in a user package registry.

Cache is per build dir, not global. Wiping it re-runs detection from scratch without touching sources, which fixes most stale-toolchain pain.

Where CMake stores this, by platform

Windows
[build directory]\CMakeCache.txt

Per-build configure cache. Delete plus CMakeFiles to force clean re-detection. Never commit it; it embeds absolute local paths.

Linux
[build directory]/CMakeCache.txt

Same role. User package registry lives in ~/.cmake/packages for find_package config-mode hints.

Frequently asked questions

How do I fix a broken CMake configure?

Delete CMakeCache.txt (and CMakeFiles) in the build dir, then reconfigure. Stale cache entries are the top cause of find-package weirdness after toolchain changes.

Notice an outdated path? Let us know.