I'd like to know if there's a way to get a list of cached variables from inside a CMakeLists.txt script. I mean, having something like this:
cmake -S . -B build -DMY_VAR1=hello -DMY_VAR2=there
and, within my CMakeLists.txt
option(MY_VAR3 "a cache setting" ON)
is there a way to get a list var MY_CACHE_LIST containing MY_VAR1, MY_VAR2 and MY_VAR3 and all other cache variables from inside the CMakeLists.txt script itself?
Thank you