title: CMake: How to run a add_custom_command before everything else
body: <p>I have a custom command</p>
  
  <pre><code>add_custom_command(
      OUTPUT config.h
      PRE_BUILD
      COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/mk_config_h.py ${CMAKE_CURRENT_BINARY_DIR}/config.h
  )
  </code></pre>
  
  <p>I'm trying to run it before everything else and I generate unix Makefiles.</p>
  
  <p>However PRE_BUILD is only supported for VS2010 which means that <code>config.h</code> is build before linking.</p>
  
  <p>how do I make a custom command before cmake starts compiling sources.</p>