During out-of-source build, after changing the cmake parameters, I want to rebuild the project without remove the entire build dir. However, there are some CMakeCache.txt files retain the old configuration from last build. In Clion there is any option to reset the cmake cache and reload the project without touching the built result. However, I cannot reproduce this behaviour with cmake command. Anyone can help me out here?
here is what I tried:
I try to remove the CMakeCache.txt files to get rid of the caches.
if I only remove the top one, it actually works fine. However, I have lots of sub-directories also contain CMakeCache.txt. Sometime the cache in subdir conflict with the newly generated top CMakeCache.txt.
Then I try to remove all of them. But it won't work. The cmake complains that it cannot add subdirectories because it is not the child dir of source code. I guess this is because the cmake getting confused when seeing the sub projects but cannot find cache variables.