No subject


Sun Apr 3 09:54:08 EDT 2011


> Note that the expression in the else and endif clause is optional.

Michael
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


--=_alternative 0038D142C2257884_=
Content-Type: text/html; charset="US-ASCII"

<font size=2 face="sans-serif">Hi</font>
<br>
<br><font size=2 face="sans-serif">if(expression)</font>
<br><font size=2 face="sans-serif">&nbsp;...</font>
<br><font size=2 face="sans-serif">endif(expression2)</font>
<br>
<br><font size=2 face="sans-serif">Makes an error since the expressions
didn't match</font>
<br>
<br><font size=2 face="sans-serif">I think this is the case with &quot;else&quot;
as well.</font>
<br>
<br><font size=2 face="sans-serif">However, i'm uncertain how to write
it when you use elseif, maybe it still needs to match with the expression
in the IF thing</font>
<br>
<br>
<br><font size=2 face="sans-serif">The reasoning behind this, AFAIK, is
to provide checking for errors in your scripts.</font>
<br>
<br><font size=2 face="sans-serif">Feel free to leave those out from else
and endif if you trust yourself : )</font>
<br>
<br><font size=2 face="sans-serif">-mika</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Michael Wild &lt;themiwi at gmail.com&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">cmake at cmake.org</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">02.05.2011 07:56</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">Re: [CMake]
If syntax</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Sent by: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">cmake-bounces at cmake.org</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>On 05/01/2011 10:30 PM, David Doria wrote:<br>
&gt; According to this:<br>
&gt; </font></tt><a href="http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:if"><tt><font size=2>http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:if</font></tt></a><tt><font size=2><br>
&gt; <br>
&gt; the syntax is:<br>
&gt; <br>
&gt; &nbsp; if(expression)<br>
&gt; &nbsp; &nbsp; ...<br>
&gt; &nbsp; elseif(expression2)<br>
&gt; &nbsp; &nbsp; ...<br>
&gt; &nbsp; else(expression)<br>
&gt; &nbsp; &nbsp; ...<br>
&gt; &nbsp; endif(expression)<br>
&gt; <br>
&gt; I was recently made aware that:<br>
&gt; <br>
&gt; <br>
&gt; &nbsp; if(expression)<br>
&gt; &nbsp; &nbsp; ...<br>
&gt; &nbsp; elseif(expression2)<br>
&gt; &nbsp; &nbsp; ...<br>
&gt; &nbsp; else()<br>
&gt; &nbsp; &nbsp; ...<br>
&gt; &nbsp; endif()<br>
&gt; <br>
&gt; should also work. Should the documentation be updated to reflect this<br>
&gt; possibility? Or are they different in some way?<br>
&gt; <br>
&gt; David<br>
<br>


More information about the CMake mailing list