How to prevent CMake reruns?

Hello dear forum dwellers!

I am working on rather a big project which is placed in mercurial repository.
I am using Visual Studio 2022.

Sadly enough, when I switch between the revisions, CMake reruns and starts a very computationally costly build. What could be the reason for that and how could I avoid that?

Some files are different between revisions, CMakeLists.txt included, placed in project root directory.

Thanks a lot

If any CMake file changes, CMake must be run again to assure correctness of the build files (in your case the vcprojx files).

I guess whatever “costly” build you do during configure, should be redesigned to be run during build. And by specifying the correct dependencies, a rebuild should only be done if necessary, not always.