[CMake] lexical scoping

Philip Lowman philip at yhbt.com
Sun Nov 4 18:19:38 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Neundorf wrote:
> 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 ?

Unless the user has defined a local variable already I would leave
things the way they are and define "global" or "makefile" specific
variables.

For example:

SETLOCAL(uc_name)
STRING(TOUPPER ${name} uc_name)

While this may be a bit cumbersome it seems the easiest way to handle
the problem.


- --
Philip Lowman
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHLlOKe0tOktX6RKkRAoIyAJ90wvQIYqXG2t7SwSgBp7DXj7OxhQCdHcAb
lBV8DsGwSkgNskpBFHkuwck=
=fzM7
-----END PGP SIGNATURE-----


More information about the CMake mailing list