I am working on a project in Mercurial with CMake in Windows Visual Studio 2022. CMake reruns every time I switch from one revision to another, which changes CMakeLists.txt, and a very time costly build follows.
Could one explain please how CMake decides the time passed to rerun? Does cmake rerun always mean regenerating all the Makefiles? How to prevent the mass compilations?