[CMake] Re: function and raise_scope commands (+ unset bug)
sebastien.barre at kitware.com
Sat Feb 16 16:01:21 EST 2008
At 2/16/2008 03:48 PM, Alexander Neundorf wrote:
>RAISE_SCOPE(var1 var2 ... varN)
>be better ?
>Why was the syntax changed from that to
>RAISE_SCOPE(varname value) ?
>(which was basically a set() and that's why converted to
>set(... PARENT_SCOPE) )
Sorry, I missed the fact that RAISE_SCOPE had changed. I thought you
guys ditched it, I remember looking for it in my local tree, and it
was gone. It should be ditched if the only thing it does is the same
as SET(... PARENT_SCOPE). But in any case it doesn't solve my "parent
of a parent scope" problem (etc.).
>Any opinion whether RAISE_SCOPE/PARENT_SCOPE should propagate to the parent
>directory if it's used outside a function ?
Yes, I gave my opinion in the other email I think. Directory,
functions, I think these should not be different cases, otherwise it
will make for too many exceptions: let's just see them as "change of
scope". So in that case, yes, for consistency, SET(... PARENT_SCOPE)
should definitely raise the value to the parent directory, i.e. to
the parent scope if you are in a directory scope. There are already
too many syntax tricks to learn, let's not add one. But if that is to
be fixed for 2.6, I would *rather* the parent_scope feature be fixed
for real-world use, i.e. function that can call functions, etc. I
know CMake is a not a programming language, but it's nice to create
More information about the CMake