# Reconfigure with the same command-line?

**URL:** <https://discourse.cmake.org/t/reconfigure-with-the-same-command-line/12733>\
**Category:** Usage\
**Created:** [October 9, 2024, 11:02pm UTC](https://discourse.cmake.org/t/reconfigure-with-the-same-command-line/12733 "2024-10-09T23:02:00Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)\
**Post date:** [October 11, 2024, 4:05am UTC](https://discourse.cmake.org/t/reconfigure-with-the-same-command-line/12733/4 "2024-10-11T04:05:07Z")

</div>

CMake does not save the command line used. Even if it did, it wouldn’t be reliable. CMake caches information between runs. The effect of the latest run should be thought of as the accumulation of earlier runs with the latest command line.

Some command-line options are not cached because they don’t affect the build, they only affect the current CMake execution in ways that don’t change the generated build project files. The various `-W` options like `-Wno-dev` or `-Wdeprecated` are one example, as are options like `--graphviz` or `--log-level`. You can’t know whether the last `cmake` invocation had such options.

As others have already mentioned, the `rebuild_cache` build target is one way to at least re-run CMake with the currently cached details. That’s probably the closest to what you’ve asked for. I’m not sure if it is supported by all CMake generators, it isn’t mentioned anywhere in the official documentation (which actually surprises me).

---

_[View the full topic](https://discourse.cmake.org/t/reconfigure-with-the-same-command-line/12733)._
