[CMake] lexical scoping

Alexander Neundorf a.neundorf-work at gmx.net
Sun Nov 4 11:16:25 EST 2007


On Sunday 04 November 2007, Philip Lowman wrote:
> Brandon Van Every wrote:
> > And strongly consider SETLOCAL, SET_LOCAL, SET_CACHE or whatever.
>
> Absolutely.  Here's what I would recommend...
>
> SET() should always set a global variable to maintain complete backwards
> compatibility.  SETCACHE() could be added to keep things consistent as
> Brandon suggests.  Trying to make SET be able to set everything is just
> going to over complicate the command... it's already complicated enough
> as it is.  What really needs to happen is to break it into three
> commands: one for globals, one for locals, and one for cache.
>
> SETLOCAL() would be used to define local variables that are local to a
> scoped region.  Scoped regions would include:

What about functions like STRING() or FILE(READ) which can return values in 
variables ?

Alex


More information about the CMake mailing list