[cmake-developers] unset and cache variables

James Touton bekenn at gmail.com
Thu Aug 16 17:38:11 EDT 2018


I just recently came across this:

set(BLAH blah CACHE INTERNAL "")
unset(BLAH)
message("BLAH: ${BLAH}")

Surprisingly (to me), this prints out "blah".  I had expected the unset
command to make the cached value inaccessible.  The documentation just
states that the function "[r]emoves the specified variable causing it to
become undefined."  Is this a bug?  I would prefer for the function to
guarantee that ${BLAH} comes up empty.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake-developers/attachments/20180816/63015060/attachment.html>


More information about the cmake-developers mailing list