如何清除Clake中的CMake缓存

如何清除Clake中的CMake缓存

本文介绍了如何清除Clake中的CMake缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正试图在我的一个项目中交换静态库,这需要交换find_package()命令来显式链接到静态库。我遇到的问题之一是,即使在删除find_package()命令重新加载CMake项目后,旧的变量仍然存在。



有一种方法来显式刷新CMake

解决方案

从CLion 1.5开始144.3143(2016) -01-20),您可以清除cmake缓存,而不会在不重新启动(意味着:非常快,也在巨大的项目)上

松开CLion索引和

 工具| CMake | 重置缓存并重新载入项目。 

如果由于某些原因还不够,或者你有一个较老的CLion,更激进:

 文件| 无效缓存/重新启动

并单击无效并重新启动。
$ b

EDITS




  • 2016-01-20:添加较新的CLion更快的方法。 >

I am currently trying to swap static libraries in one of my projects which requires swapping find_package() commands for explicit links to static libraries. One of the problems I encountered is that even after deleting find_package() commands reloading the CMake Project the old variables are still present.

Is there a way to explicitly flush the CMake cache other than manually deleting all files from the temporary folder Clion creates for building the project?

解决方案

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.

这篇关于如何清除Clake中的CMake缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 09:12