title: cmake check if Mac OS X, use APPLE or ${APPLE}
body: <p>I would like check whether I am in Mac OS X or not, and have the following code</p>
  
  <pre><code>cmake_minimum_required (VERSION 3.0)
  project (test)
  set (FOO 1)
  if (${FOO} AND ${APPLE})
    message ("MAC OS X")
  endif ()
  </code></pre>
  
  <p>It failed on non-OSX system with error message</p>
  
  <pre><code>CMake Error at CMakeLists.txt:4 (if):
    if given arguments:
  
      "1" "AND"
  
    Unknown arguments specified
  </code></pre>
  
  <p>If I replace <code>${APPLE}</code> with <code>APPLE</code>, the error went away. But I am a little puzzled by this. When should we refer to a variable with <code>${VAR}</code> and when should we not to?</p>
  
  <p>Thanks in advance.</p>