title: CMake: Get version from multiline text file
body: <p>I have a file <code>version.txt</code></p>
  
  <pre><code>VERSION_MAJOR 1
  VERSION_MINOR 1
  VERSION_PATCH 3
  </code></pre>
  
  <p>I want to use cmake to add a definition for major, minor and patch.</p>
  
  <p>I've tries using </p>
  
  <pre><code>file(STRING "version.txt" myvar)
  </code></pre>
  
  <p>but this just puts the whole file in <code>myvar</code>.</p>
  
  <p>How do I get the numbers?</p>