<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Sep 4, 2014 at 1:44 PM, Clark Wang <span dir="ltr"><<a href="mailto:dearvoid@gmail.com" target="_blank">dearvoid@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="">On Thu, Sep 4, 2014 at 1:36 PM, Chuck Atkins <span dir="ltr"><<a href="mailto:chuck.atkins@kitware.com" target="_blank">chuck.atkins@kitware.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Clark<br><div class="gmail_extra"><br>The expression inside the if statement has it's variables dereferenced before evaluating and the non-variables are treated as constant expressions.  In this case, a resolves to "b", b resolves to "c", and c is not a variable so it's treated as the constant expression "c".  Thus<div>


<br>

<br><span style="font-family:courier new,monospace">if(a STREQUAL b OR a STREQUAL c)<br></span><br></div></div><div class="gmail_extra">gets evaluated as<br><br><span style="font-family:courier new,monospace">if( ("b" STREQUAL "c") OR ("b" STREQUAL "c") )<br>


</span></div></div></blockquote><div><br></div></div><div>Thanks a lot. It's clear now. But is there a way to check if the value of the variable a equals to "b" or "c"?<span class=""><font color="#888888"><br>

</font></span></div></div></div></div></blockquote><div><br>Found <a href="http://stackoverflow.com/questions/19982340/cmake-compare-to-empty-string-with-strequal-failed">http://stackoverflow.com/questions/19982340/cmake-compare-to-empty-string-with-strequal-failed</a> which suggests to use if(a MATCHES "^b$").<br>

<br></div><div>-clark<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>

<span class=""><font color="#888888"><br></font></span></div><span class=""><font color="#888888"><div>-clark<br></div></font></span><div class="">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span style="font-family:courier new,monospace">

<br></span></div><div class="gmail_extra"><span style="font-family:courier new,monospace"><font face="arial,helvetica,sans-serif">which is clearly false.  Hope that helps.<span><font color="#888888"><br><br>
</font></span></font></span></div><span><font color="#888888"><div class="gmail_extra">

<span style="font-family:courier new,monospace"><font face="arial,helvetica,sans-serif">- Chuck<br></font></span></div><div class="gmail_extra"><br></div></font></span></div>
</blockquote></div></div><br></div></div>
</blockquote></div><br></div></div>