Ok interesting, it is working for me too. I guess my reproducible use case was invalid.<div><br></div><div>(BTW, I&#39;m running through cmake-gui on Windows 7 x64 using CMake version 2.8.5)<br><div><br></div><div>My use case was a simplified version of the real code. FUBARTEST is actually a cache variable defined by the root CMakeLists.txt file. In my real test case, my STREQUAL statement is failing to execute the conditional code when I do this:</div>
<div><br></div><div>if( NEMO_TARGET STREQUAL &quot;NSPR&quot; )</div><div><br></div><div>However if I do this, it works:</div><div><br></div><div>if( &quot;${NEMO_TARGET}&quot; STREQUAL &quot;NSPR&quot; )</div><div><br></div>
<div>I don&#39;t know why both would behave differently. Just to rule out the cache variable being the issue, I tried this (I attempted to make the SET() call override the originally defined cache variable. I did not actually remove the variable from cache):</div>
<div><br></div><div><div>set( NEMO_TARGET &quot;NSPR&quot; )</div><div>if( NEMO_TARGET STREQUAL &quot;NSPR&quot; )</div><div><br></div><div>Of course, this statement did not result in the enclosed message() being executed.</div>
<div><br></div><div>I have tried creating a small test case to reproduce this issue but so far I have been unsuccessful. I&#39;ll try clearing my cache to rule out any issues there. In the meantime if you have any suspicions or have run into this before, please give me some ideas on how to solve this :)</div>
<div><br></div><div>Thanks.</div><div><br></div><div>---------</div>Robert Dailey<br>
<br><br><div class="gmail_quote">On Thu, Oct 6, 2011 at 1:31 PM, Eric Noulard <span dir="ltr">&lt;<a href="mailto:eric.noulard@gmail.com">eric.noulard@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2011/10/6 Robert Dailey &lt;<a href="mailto:rcdailey@gmail.com">rcdailey@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; According to the CMake documentation, the `STREQUAL` comparison is allowed<br>
&gt; to take either a VARIABLE or a STRING as either parameter. So, in this<br>
&gt; example below, the message does NOT print, which is broken:<br>
&gt;     set( FUBARTEST &quot;OK&quot; )<br>
&gt;     if( FUBARTEST STREQUAL &quot;OK&quot; )<br>
&gt;     message( &quot;It Worked&quot; )<br>
&gt;     endif()<br>
&gt; Any reason why this isn&#39;t working as documented?<br>
<br>
</div></div>Don&#39;t know but it works just fine for on Linux + CMake 2.8.6<br>
which cmake version are you using?<br>
<br>
Could you try running<br>
cmake --trace --debug-output -P  fubartest.cmake<br>
<br>
and tell us waht&#39;s printed out?<br>
<font color="#888888"><br>
<br>
<br>
--<br>
Erk<br>
Membre de l&#39;April - « promouvoir et défendre le logiciel libre » -<br>
<a href="http://www.april.org" target="_blank">http://www.april.org</a><br>
</font></blockquote></div><br></div></div>