title: Version Numbers in a project with Qt
body: <p>Version numbers are needed all over a project; in installers, code, toolchains etc. I despise duplication. I want my version numbers to be stored in one central authoritative location.</p>
  
  <p>I am working with C/C++ and using Qt on various platforms. In Qt, qmake projects specify version numbers like:</p>
  
  <pre><code>VERSION = 1.2.3
  </code></pre>
  
  <p>In code I use something like in a header like Version.h:</p>
  
  <pre><code>#define VERSION_MAJ 1
  #define VERSION_MIN 2
  #define VERSION_REV 3
  #define VERSION_STRING \"VERSION_MAJ\" "." \"VERSION_MIN\" "." \"VERSION_REV\"
  </code></pre>
  
  <p>My installer toolchain has support for C preprocessing so I can use the same version specified in Version.h. However, I don't know how to get qmake to use the same version number. I thought I could preprocess the pro file, but that won't work as # characters mean a comment in pro files and the C preprocessor will fall over.</p>
  
  <p>Anyone know of a good way to keep my version number centralised?</p>