How to get a CMake variable from the command line?
If you have an existing cache file, you can do: grep MY_CMAKE_VARIABLE CMakeCache.txt If you do not yet have a cache file and you want to see what options there are in a CMakeLists.txt file, you can do (in a different directory since this will write a cache file): cmake -L /path/to/CMakeLists.txt | grep MY_CMAKE_VARIABLE …