I have vague understanding of what CMake cache is, but I am not sure why it is used for options.
When it comes to options it seems like horrible idea. This is a quote from answer about why if does not work with options:
So to test the logic in your CMakeLists, delete the cache each time before re-running CMake.
I am not a functional programming person, but for me it is totally insane to have sticky state for options like this.
I presume there is some reason why CMake choose to have this design. In other words what is the motivation for putting options in cache?