I think you probably wanted to write and call your function like this:<br><br>FUNCTION(build var)<br>       MESSAGE(STATUS &quot;var: ${var}&quot;)<br>ENDFUNCTION(build)<br><br>SET(var red blue yellow green)<br>build(&quot;${var}&quot;)<br>
<br>That prints out as you would expect:<br><br>-- var: red;blue;yellow;green<br><br>--<br>Glenn<br><br><br><div class="gmail_quote">On 12 May 2011 07:27, Rolf Eike Beer <span dir="ltr">&lt;<a href="mailto:eike@sf-mail.de">eike@sf-mail.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">&gt; This is funny:<br>
&gt; FUNCTION(build var)<br>
&gt;       MESSAGE(STATUS &quot;var: &quot; ${${var}})<br>
&gt; ENDFUNCTION(build)<br>
&gt;<br>
&gt; SET(var red blue yellow green)<br>
&gt; build(var)<br>
&gt;<br>
&gt; Output:<br>
&gt; -- var: var<br>
&gt;<br>
&gt; SET(varX red blue yellow green)<br>
&gt; build(varX)<br>
&gt; Output:<br>
&gt; -- var: redblueyellowgreen<br>
<br>
</div>No, it must be that way. Inside build() var is defined as the variable<br>
that is defined in the interface. build() has no way to see the variable<br>
outside it because it can only find the inner name. It could reference<br>
it&#39;s value if you had passed the value or it could reference the variable<br>
by name if it would not be hidden by your interface variable.<br>
<br>
int a = 2;<br>
<br>
int build(int a)<br>
{<br>
 return a;<br>
}<br>
<br>
int b = build(42);<br>
<br>
b will be 42.<br>
<font color="#888888"><br>
Eike<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br>