[Cmake] Strange

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


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 

 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20020809/62e7ca83/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: James Miller (E-mail).vcf
Type: application/octet-stream
Size: 606 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/cmake/attachments/20020809/62e7ca83/attachment.obj>


More information about the CMake mailing list