<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ok - thanks, that works.<br>
<br>
David Cole wrote:
<blockquote
 cite="midf435c2c50707190340g215cef4eh15f316a6c5cbd273@mail.gmail.com"
 type="cite">When dealing with ENV variable values, you should probably
test their contents with something like this:<br>
  <br>
IF("$ENV{FOO}" STREQUAL "ON")<br>
... ... ...<br>
ENDIF("$ENV{FOO}" STREQUAL "ON")
  <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'm trying to work out how to test for an environment variable in an IF
    <br>
command, the following doesn't work:<br>
    <br>
SET(ENV{FOO} ON)<br>
MESSAGE("FOO = $ENV{FOO}")&nbsp;&nbsp;&nbsp;&nbsp;# prints "FOO = ON"<br>
IF(ENV{FOO})<br>
&nbsp;&nbsp;MESSAGE("FOO is set")<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>
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>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
CMake mailing list
<a class="moz-txt-link-abbreviated" href="mailto:CMake@cmake.org">CMake@cmake.org</a>
<a class="moz-txt-link-freetext" href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a></pre>
</blockquote>
<br>
</body>
</html>