How to clear CMake cache in Clion?

拟墨画扇 提交于 2019-11-29 02:49:00

Starting with CLion 1.5 144.3143 (2016-01-20), you can clear the cmake cache without loosing the CLion indexes and without restarting (meaning: very fast, also on huge projects):

Tool | CMake | "Reset cache and reload project".

If that for some reasons is not enough, or if you have an older CLion, you can do the more radical:

File | "Invalidate Caches / Restart" 

and click on "Invalidate and restart".

EDITS

  • 2016-01-20: add the faster method available with newer CLion.

There is some magic with this cache. I got bad value for one variable once: by some reason cmake found some wrecked freetype includes inside mono.framework (another reason to dislike mono...) and tried to use them to compile my project. Obviously compilation failed.

I tried to remove CMakeCache.txt and rebuild project but incorrect path come back. Even after I removed mono.framework dir!

The solution was to remove incorrect line from the cache and restart the build. After that cmake got the correct path and build succeded.

UPD: After I "reload cmake project" incorrect value came back. Deleting everything in $HOME/Library/Caches/clion11/cmake/generated/ dir (for OS X) seems to finally solve the issue.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!