title: CMake custom command to generate a non-config file
body: <p>I've read:</p>
  <p><a href="https://stackoverflow.com/questions/18590445/cmake-custom-command-to-copy-and-rename">cmake custom command to copy and rename</a></p>
  <p>and I want to do something similar, but rather than copying a file, I want to generate a file. If that wasn't in a custom command, I would write:</p>
  <pre><code>file(WRITE &quot;generated.c&quot; &quot;int main() { return 0; }&quot;)
  </code></pre>
  <p>but it doesn't seem like <code>cmake -E</code> supports this directly. What should I do (other than run something platform-dependent)?</p>