When dealing with ENV variable values, you should probably test their contents with something like this:<br><br>IF(&quot;$ENV{FOO}&quot; STREQUAL &quot;ON&quot;)<br>... ... ...<br>ENDIF(&quot;$ENV{FOO}&quot; STREQUAL &quot;ON&quot;)
<br><br>&nbsp;--- or ---<br><br>SET(myFOO $ENV{FOO})<br>IF(myFOO)<br>
... ... ...<br>ENDIF(myFOO)<br>
<br><br>HTH,<br>David<br><br><br><div><span class="gmail_quote">On 7/19/07, <b class="gmail_sendername">Mike Talbot</b> &lt;<a href="mailto:mtalbot@abingdon.oilfield.slb.com">mtalbot@abingdon.oilfield.slb.com</a>&gt; wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br><br>I&#39;m trying to work out how to test for an environment variable in an IF
<br>command, the following doesn&#39;t work:<br><br>SET(ENV{FOO} ON)<br>MESSAGE(&quot;FOO = $ENV{FOO}&quot;)&nbsp;&nbsp;&nbsp;&nbsp;# prints &quot;FOO = ON&quot;<br>IF(ENV{FOO})<br>&nbsp;&nbsp;MESSAGE(&quot;FOO is set&quot;)<br>ENDIF(ENV{FOO})<br><br>
Does anyone know what the right syntax for doing this is, please?<br><br>Thanks,<br>Mike<br><br>--<br>Mike Talbot<br>Core Petrel Architect (Abingdon)<br>Schlumberger<br>Lambourn Court, Wyndyke Furlong,<br>Abingdon Business Park, Abingdon,
<br>Oxfordshire, OX14 1UJ, UK<br>Office: +44 (0)1235 543 488<br>Mobile: +44 (0)7790 382 746<br><br>_______________________________________________<br>CMake mailing list<br><a href="mailto:CMake@cmake.org">CMake@cmake.org</a>
<br><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>