[CMake] Re: function and raise_scope commands

Alexander Neundorf a.neundorf-work at gmx.net
Fri Jan 18 12:54:46 EST 2008


On Friday 18 January 2008, Rodolfo Schulz de Lima wrote:
> Miguel A. Figueroa-Villanueva wrote:
> > Again, I think this behaviour is a quite unintuitive and should be
> > well documented, at least.
>
> I shall add that at first I expected 'raise_scope' to work like 'set'
> when the parameter <value> is a list. But, for instance:
>
> set(mylist item1 item2 item3)
>
> set(var1 ${mylist})
> raise_scope(var2 ${mylist})
>
> in this example, var1 gets the 3 items, whereas var2 gets only 'item1'.
> That's odd and also counterintuitive.

How about the attached patch ?
It adds an argument PARENT_SCOPE to the SET() command, which then replaces the 
RAISE_SCOPE() command:

set(foo a b c PARENT_SCOPE)

I'm not sure it is a good idea that this also propagates to the parent 
directory. What is a use case for this ?

Bye
Alex
-------------- next part --------------
A non-text attachment was scrubbed...
Name: set_parent_scope.patch
Type: text/x-diff
Size: 2215 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20080118/ac5c5be4/set_parent_scope.bin


More information about the CMake mailing list