Is there a safe way to edit a cache variable from

2019-02-17 14:02发布

As far as I know, CMake only comes with graphical cache editors. However, I need to edit some cache variables from a shell script. One way is to directly edit CMakeCache.txt but this is not considered safe. Or is it? If not, what is the general practice of editing a cache variable from the command line?

标签: cmake
1条回答
家丑人穷心不美
2楼-- · 2019-02-17 14:42

You may call cmake:

  • with -D option(s) for set/modify cache variables, or
  • with -U option(s) for remove variables from the cache.

Running cmake will cause the project to be reconfigured, but this should be an ultimate purpose of a any cache modification.

查看更多
登录 后发表回答