Inconsistent handling of "set" binding vs. cache entry in script mode
While there is no persistent cache in script mode, "cache entries" may be used anyway. Documentation states:
If a "set" binding is found, its value is used. If an "unset" binding is found, or no binding is found, CMake then searches for a cache entry. If a cache entry is found, its value is used. Otherwise, the variable reference evaluates to an empty string.
However, the following script demonstrates different behaviour.
set(FOO "Set binding")
set(FOO "Cached value" CACHE STRING "doc")
message(STATUS "1 ${FOO}")
unset(FOO CACHE)
message(STATUS "2 ${FOO}")
Actual Output is:
-- 1 Cached value
-- 2
Expected Output is:
-- 1 Set binding
-- 2 Set binding