<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o = "urn:schemas-microsoft-com:office:office"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4916.2300" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=463181814-09082002><FONT face=Arial size=2>Hey
Jim,</FONT></SPAN></DIV>
<DIV><SPAN class=463181814-09082002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=463181814-09082002><FONT face=Arial size=2>CMake uses
immediate evaluation as you can see. The else clause evaluates its arguments
independently from the IF clause. Basically ELSE is the same
as:</FONT></SPAN></DIV>
<DIV><SPAN class=463181814-09082002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=463181814-09082002><FONT face=Arial size=2>ENDIF
(foo)</FONT></SPAN></DIV>
<DIV><SPAN class=463181814-09082002><FONT face=Arial size=2>IF (NOT
foo)</FONT></SPAN></DIV>
<DIV><SPAN class=463181814-09082002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=463181814-09082002><FONT face=Arial size=2>This is a bit
confusing and I'm pretty sure I can modify it. I don't think anything relies on
this behaviour right now so I'll take a stab at changing it later today.
</FONT></SPAN></DIV>
<DIV><SPAN class=463181814-09082002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=463181814-09082002><FONT face=Arial
size=2>Thanks</FONT></SPAN></DIV>
<DIV><SPAN class=463181814-09082002><FONT face=Arial
size=2>Ken</FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2><BR></FONT> </DIV>
<DIV><SPAN class=144520814-09082002><FONT size=2>I may not be understanding
how CMake handles IF/ELSE/ENDIF constructs. Or this could </FONT></SPAN></DIV>
<DIV><SPAN class=144520814-09082002><FONT size=2>be a bug. The following
CMakeLists.txt file outputs both "Not Bar" and "Bar" indicating to
</FONT></SPAN></DIV>
<DIV><SPAN class=144520814-09082002><FONT size=2>me that both the IF clause
and the ELSE clause are being executed. If I remove the
SET</FONT></SPAN></DIV>
<DIV><SPAN class=144520814-09082002><FONT size=2>command then the ELSE clause
is not executed.</FONT></SPAN></DIV>
<DIV><SPAN class=144520814-09082002><FONT size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=144520814-09082002><FONT size=2>What "should" happen in this
case?</FONT></SPAN></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>PROJECT(FOO)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT size=2>IF (NOT BAR)<BR> MESSAGE("Not
Bar")<BR> SET(BAR "garf")<BR>ELSE (NOT BAR)<BR>
MESSAGE("Bar")<BR>ENDIF (NOT BAR)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT size=2></FONT> </DIV></BLOCKQUOTE></BODY></HTML>