# Default values for cache variables

**URL:** https://discourse.cmake.org/t/default-values-for-cache-variables/11082
**Category:** Development
**Created:** [June 23, 2024, 4:27am UTC](https://discourse.cmake.org/t/default-values-for-cache-variables/11082 "2024-06-23T04:27:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [June 23, 2024, 4:27am UTC](https://discourse.cmake.org/t/default-values-for-cache-variables/11082/1 "2024-06-23T04:27:54Z")

</div>

Hi all,

A long-ago feature request (I filed it 10 years ago!) has finally had some interest in a prerequisite feature: CMake needs to know what the default value for user options are in order to report “here’s what you’ve done to configure this build”. This (later) feature would allow something like `cmake -E make_cache_init` to take a build tree and dump out a file that can be passed to `cmake -C` to recreate the build.

But first is teaching CMake to understand that the “default” value passed to `option()` or `set(CACHE)` is pinned on the first configure; updating the default in the code does not update older builds.

The full design proposal is [here](https://gitlab.kitware.com/cmake/cmake/-/issues/14756#note_1538750). Feel free to comment here for discussion related to the feature, but anything about the specific proposal should go to the issue.

Thanks,

–Ben
