Hi,<br><br>I learned something very valuable today about cmake after getting an unexpected result with STREQUAL:<br><br>set(foo bar)<br>...<br>set(baz foo)<br>...<br>if("${baz}" STREQUAL "bar") # This evaluates to true.<br>
...<br><br>I expected it to be false, because I was trying to get baz's value ("foo") to compare with "bar". I thought that parameters explicitly quoted were treated as strings.<br><br>Then I learned that the interpreter is the only one that sees quotes around parameters, for the sole purpose of string interpolation and preventing whitespace from splitting a parameter. Cmake commands do not see these quotes. Therefore, STREQUAL can never know the difference between "baz" and baz.<br>
<br>So, STREQUAL treats a parameter as a variable name if it is defined, but as a string value if it is not. (I verified this in cmIfCommand.cxx)<br><br>Is this quote behavior well-known among cmake users? For others like me, I'd like this behavior to be emphasized in the cmake docs for STREQUAL.<br>
<br>Happy Valentine's.<br><br>Shaun<br>