[CMake] function and raise_scope commands

Filipe Sousa natros at gmail.com
Fri Dec 7 18:53:56 EST 2007


Miguel A. Figueroa-Villanueva wrote:
> On Dec 7, 2007 6:42 PM, Filipe Sousa wrote:
> 
> Try the following:
> 
>  function(foo x)
>   set(${x} 1)                     # changed here
>   raise_scope(${x})
>  endfunction()
> 
>  foo(y)
>  message(STATUS "y=${y}")
> 
> I have this working. What gives me problems is calling foo(x), since x
> is the same name as the function argument. So unless this is fixed, I
> suggest you use names for function arguments that are not likely to be
> used themselves as the name of the variable to be passed to the
> function. That is, I would do: function(foo _x). Or something like
> that.
> 
> Hope this helps.

Yes it works, thanks!

-- Filipe Sousa

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://public.kitware.com/pipermail/cmake/attachments/20071207/6709a6f6/signature.pgp


More information about the CMake mailing list