title: CMake compare to empty string with STREQUAL failed
body: <p>I always think that if you want to compare two strings (but not variables) all you need to do is to quote it like that:</p>
  
  <pre><code>if("${A}" STREQUAL "some string")
  </code></pre>
  
  <p>but now I find out that this code sometimes print <code>oops</code>:</p>
  
  <pre><code>cmake_minimum_required(VERSION 2.8)
  
  if("d" STREQUAL "")
    message("oops...")
  endif()
  </code></pre>
  
  <p>May be it's bug (because it prints with <a href="https://travis-ci.org/travis-ci-tester/travis-test-cmake/builds/13974968#L133">Xcode</a>, but not with <a href="https://travis-ci.org/travis-ci-tester/travis-test-cmake/builds/13974968#L145">make</a>)?
  Or there is some special variables?</p>
  
  <ul>
  <li>cmake: 2.8.12, 2.8.11.2</li>
  <li>xcode: 4.6.2, 5.0.1</li>
  </ul>
  
  <p><strong>Update</strong></p>
  
  <p>There is command <a href="http://www.cmake.org/cmake/help/v2.8.12/cmake.html#command:string">string</a> without described problems:</p>
  
  <pre><code>string(COMPARE EQUAL "${A}" "" result)
  if(result)
    message("...")
  endif()
  </code></pre>
  
  <p><strong>Update 2</strong></p>
  
  <p>The behaviour I've expected implemented since <a href="http://www.kitware.com/blog/home/post/812">CMake 3.1.0</a> (see <a href="http://www.cmake.org/cmake/help/v3.1/policy/CMP0054.html">CMP0054</a>).</p>
  
  <p>Output of the 3.0.2 <a href="http://pastebin.com/ajKdnV3W">test</a>:</p>
  
  <pre><code>CMake version: 3.0.2
  Quoted test
  Surprise!
  Unquoted test
  Surprise!
  </code></pre>
  
  <p>Output of the 3.1.0 <a href="http://pastebin.com/6Nwk8MMc">test</a>:</p>
  
  <pre><code>CMake version: 3.1.0
  Quoted test
  OK
  Unquoted test
  Surprise!
  </code></pre>