[Cmake] Strange

Miller, James V (Research) millerjv at crd . ge . com
Fri, 9 Aug 2002 10:12:04 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C23FAE.BCDCE80E
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C23FAE.BCDCE80E"


------_=_NextPart_001_01C23FAE.BCDCE80E
Content-Type: text/plain;
	charset="iso-8859-1"

I may not be understanding how CMake handles IF/ELSE/ENDIF constructs. Or this could 
be a bug.  The following CMakeLists.txt file outputs both "Not Bar" and "Bar" indicating to 
me that both the IF clause and the ELSE clause are being executed.  If I remove the SET
command then the ELSE clause is not executed.
 
What "should" happen in this case?
 
 
PROJECT(FOO)
 
IF (NOT BAR)
   MESSAGE("Not Bar")
   SET(BAR "garf")
ELSE (NOT BAR)
   MESSAGE("Bar")
ENDIF (NOT BAR)
 
 

 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Jim Miller 
_____________________________________
Visualization & Computer Vision
GE Research
Bldg. KW, Room C218B
P.O. Box 8, Schenectady NY 12301

millerjv at research . ge . com <mailto:millerjv at research . ge . com> 

james . miller at research . ge . com
(518) 387-4005, Dial Comm: 8*833-4005, 
Cell: (518) 505-7065, Fax: (518) 387-6981 

 

 

------_=_NextPart_001_01C23FAE.BCDCE80E
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2715.400" name=GENERATOR></HEAD>
<BODY>
<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.&nbsp; 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.&nbsp; 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>&nbsp;</DIV>
<DIV><SPAN class=144520814-09082002><FONT size=2>What "should" happen in this 
case?</FONT></SPAN></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>PROJECT(FOO)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>IF (NOT BAR)<BR>&nbsp;&nbsp; MESSAGE("Not 
Bar")<BR>&nbsp;&nbsp; SET(BAR "garf")<BR>ELSE (NOT BAR)<BR>&nbsp;&nbsp; 
MESSAGE("Bar")<BR>ENDIF (NOT BAR)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV class=Section1>
<P class=MsoNormal>&nbsp;<?xml:namespace prefix = o ns = 
"urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>
<P style="MARGIN: 0in 0in 0pt"><B><SPAN 
style="COLOR: navy; FONT-FAMILY: 'Comic Sans MS'">Jim Miller</SPAN></B> 
<BR><B><I><SPAN 
style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Arial">_____________________________________</SPAN></I></B><BR><EM><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Visualization &amp; 
Computer Vision</SPAN></EM><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial"><BR><EM>GE 
Research</EM><BR><EM>Bldg. KW, Room C218B</EM><BR><EM>P.O. Box 8, Schenectady NY 
12301</EM><BR><BR></SPAN></I><EM><U><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: blue"><A 
href="mailto:millerjv at research . ge . com">millerjv at research . ge . com</A></SPAN></U></EM></P>
<P style="MARGIN: 0in 0in 0pt"><EM><U><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: blue">james . miller at research . ge . com</SPAN></U></EM><BR><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">(518) 387-4005, Dial 
Comm: 8*833-4005, </SPAN></I><BR><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Cell: (518) 505-7065, 
Fax: (518) 387-6981</SPAN></I> </P>
<P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C23FAE.BCDCE80E--

------_=_NextPart_000_01C23FAE.BCDCE80E
Content-Type: application/octet-stream;
	name="James Miller (E-mail).vcf"
Content-Disposition: attachment;
	filename="James Miller (E-mail).vcf"

BEGIN:VCARD
VERSION:2.1
N:Miller;James
FN:James Miller (E-mail)
ORG:GE Reseach;Imaging Technologies
TEL;WORK;VOICE:(518) 387-4005
TEL;WORK;VOICE:*833-4005
TEL;CELL;VOICE:(518) 505-7065
TEL;WORK;FAX:(518) 387-6981
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;Visualization and Computer Vision;BLDG KW, RM C218B=0D=0APO Box 8;Schenecta=
dy;NY;12301;United States of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Visualization and Computer Vision=0D=0ABLDG KW, RM C218B=0D=0APO Box 8=0D=
=0ASchenectady, NY 12301=0D=0AUnited States of America
EMAIL;PREF;INTERNET:millerjv at research . ge . com
REV:20020405T145025Z
END:VCARD

------_=_NextPart_000_01C23FAE.BCDCE80E--