Is there a safe way to edit a cache variable from

2019-02-17 13:58发布

问题:

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?

回答1:

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.



标签: cmake