title: Make cmake pass command line variable to compiler
body: <p>I have following code:</p>
  
  <pre><code>int main() {
  #ifdef COMMIT_VERSION
     cout &lt;&lt; "app version: " &lt;&lt; COMMIT_VERSION &lt;&lt; endl;
  #endif
  }
  </code></pre>
  
  <p>I would like to invoke cmake such that it passes COMMIT_VERSION variable defined on command line to g++ and thus to my application. E.g. 
  following invocation:</p>
  
  <pre><code>cmake -WHAT_IS_THE_OPTION_NAME COMMIT_VERSION='"Hello Version"'
  make
  ./a.out
  </code></pre>
  
  <p>produces output</p>
  
  <pre><code>app version: Hello Version
  </code></pre>