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"> ...</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 "else"
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:
</font><font size=1 face="sans-serif">Michael Wild <themiwi at gmail.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">cmake at cmake.org</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">02.05.2011 07:56</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">Re: [CMake]
If syntax</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Sent by:
</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>
> According to this:<br>
> </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>
> <br>
> the syntax is:<br>
> <br>
> if(expression)<br>
> ...<br>
> elseif(expression2)<br>
> ...<br>
> else(expression)<br>
> ...<br>
> endif(expression)<br>
> <br>
> I was recently made aware that:<br>
> <br>
> <br>
> if(expression)<br>
> ...<br>
> elseif(expression2)<br>
> ...<br>
> else()<br>
> ...<br>
> endif()<br>
> <br>
> should also work. Should the documentation be updated to reflect this<br>
> possibility? Or are they different in some way?<br>
> <br>
> David<br>
<br>
More information about the CMake
mailing list