Hi,<br><br>Me and a work friend ran into the same problem a few days ago. May I suggest to the admins to add a little note in the IF doc about this common mistake ?<br><br>Regards,<br>--<br>Mehdi<br><br><div class="gmail_quote">
On Fri, Feb 22, 2008 at 4:08 PM, Fernando Cacciola &lt;<a href="mailto:fernando.cacciola@gmail.com">fernando.cacciola@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Sylvain Benner wrote:<br>
&gt;&gt; Now, why didn&#39;t<br>
&gt;&gt;<br>
&gt;&gt; if ( $ENV{SOME_ENV_VAR} )<br>
&gt;&gt;<br>
&gt;&gt; work?<br>
&gt;&gt;<br>
&gt;<br>
&gt; Because $ENV{SOME_ENV_VAR} has the same behavior as ${SOME_ENV_VAR}, it<br>
&gt; evaluates a variable. The only difference is that ${} is a CMake<br>
&gt; variable and $ENV{} is an operating system environment variable.<br>
&gt;<br>
<br>
</div>OK, now I think about it, this expected.<br>
<div class="Ih2E3d"><br>
&gt; I assume that IF statement only scan for CMake variables so you must do<br>
&gt; like you did: turn the environment variable into a CMake variable to<br>
&gt; make the conditional statement work.<br>
&gt;<br>
&gt;<br>
</div>I just realized that I haven&#39;t really understood IF until now: it doesn&#39;t<br>
take a value as argument (like the IF of any other language I ever came<br>
across), &nbsp;but a variable.<br>
<br>
Best<br>
<div class="Ih2E3d"><br>
<br>
--<br>
Fernando Cacciola<br>
SciSoft<br>
<a href="http://fcacciola.50webs.com" target="_blank">http://fcacciola.50webs.com</a><br>
<a href="http://groups.google.com/group/cppba" target="_blank">http://groups.google.com/group/cppba</a><br>
<br>
<br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="Wj3C7c">CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><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>