title: Ambiguous documentation (until Ver 3.2) for how to define a (cached) variable in cmake from command line?
body: <p>Looking at <a href="http://www.cmake.org/cmake/help/v3.2/manual/cmake.1.html" rel="nofollow">CMake documentation for the command line options</a>, there's some ambiguity in the <code>-D</code> option used to define a variable.</p>
  
  <p>In the command line synopsis there's</p>
  
  <pre><code>-D&lt;var&gt;=&lt;value&gt;
  </code></pre>
  
  <p>While in the option description we read:</p>
  
  <pre><code>-D &lt;var&gt;:&lt;type&gt;=&lt;value&gt;
  </code></pre>
  
  <p>The two entries differ by a space between <code>-D</code> and the variable definition, and by the presence/absence of <code>:&lt;type&gt;</code>.</p>
  
  <p>Does the space make any difference? What is the difference between specifying or not the type? Is it cached in any case?</p>
  
  <p>From a quick test, it seems the space is optional. While if the variable type is not specified, the variable goes in <code>CMakeCache.txt</code> as:</p>
  
  <pre><code>//No help, variable specified on the command line.
  MYVARIABLENAME:UNINITIALIZED=MYVARIABLEVALUE
  </code></pre>
  
  <p>And it will not appear in the cache of cmake-gui.</p>
  
  <p>Are these behaviours documented anywhere?</p>
  
  <p><hr/>
  <strong>Edit:</strong><br/>
  I have <a href="http://www.cmake.org/Bug/view.php?id=15575" rel="nofollow">reported an issue</a> in CMake bug tracker. As visible in the link, it seems that some solution was already on its way, and <strong>documentation should be fixed for CMake 3.3!</strong>.</p>