In CMakeLists.txt, when I use SET(VARIABLE, value), I would expect that running cmake -LA CMakeLists.txt would cause the CMakeCache.txt file generated to show the value of this variable. It doesn't. How do I view the values of set variables?
Asked
Active
Viewed 1,422 times
0
-
2For the differences between and usage of "normal" and "cached" variables - including how to "debug" variables - see [What's the CMake syntax to set and use variables?](http://stackoverflow.com/questions/31037882/whats-the-cmake-syntax-to-set-and-use-variables). And you might find [Get a list of variables with a specified prefix](http://stackoverflow.com/questions/12521452/get-a-list-of-variables-with-a-specified-prefix) interesting. – Florian Nov 19 '15 at 10:39
1 Answers
0
File CMakeCache.txt
contains only cached variables. These ones are set using
set(VARIABLE value CACHE ...)
command flow or using some other commands(e.g. find_path
), documentation for which explicitely says about cache variables.
Variables, assigned using simple
set(VARIABLE value)
are temporary, and exists only while CMake interpret script(CMakeLists.txt). There is no way to list such variables outside of script interpreting process.

Tsyvarev
- 60,011
- 17
- 110
- 153