[CMake] Parameters of functions

Micha Renner Micha.Renner at t-online.de
Thu May 12 08:21:48 EDT 2011


Am Donnerstag, den 12.05.2011, 11:50 +0100 schrieb Glenn Coombs:
> I think you probably wanted to write and call your function like this:
> 
> FUNCTION(build var)
>        MESSAGE(STATUS "var: ${var}")
> ENDFUNCTION(build)
> 
> SET(var red blue yellow green)
> build("${var}")
> 
> That prints out as you would expect:
> 
> -- var: red;blue;yellow;green
> 
Both versions are possible. 
My point was, that in the case I described, the name of the parameter of
the function may not be the same as the name of variable the function is
called.

With your version you don't have this problem.
Thanks.

Micha





More information about the CMake mailing list