[cmake-developers] set(CACHE) and the local scope

Alexander Neundorf neundorf at kde.org
Thu Dec 10 15:20:21 EST 2015


On Wednesday, December 09, 2015 17:35:28 Ben Boeckel wrote:
> Hi,
> 
> So some behavior I was unaware of until today came up:
> 
>     set(var ON)
>     option(var "description" OFF)
>     message("var: ${var}")

Assuming I wouldn't know about the subtle characteristics of normal vs. 
cache variables, I think I would expect that var has the value of the option 
afterwards.

I.e. on the first run it would be OFF (since that's the default value of the 
option), and all later runs it would have the value which is in the cache.

Alex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20151210/66746811/attachment.html>


More information about the cmake-developers mailing list