title: Getting qmake to properly run my code-generator
body: <p>Here's my situation:</p>
  
  <p>I have a typical Qt C++ project that I'm building with qmake (.pro file).</p>
  
  <p>I also have a python script that generates some code. The python script (let's call it update.py) generates three files, let's call them gen.h, gen.cpp, gen.qml.</p>
  
  <p>Now what I'm doing now is manually running update.py in order to generate those files. Then I can run make and everything builds OK. The gen.h and gen.cpp are just "regular" files in my .pro file and they are checked into SVN.</p>
  
  <p>What I want instead is to make it so that when I run make, update.py will get run and generate those files, and then they will get built along with the project. This way I can remove them from SVN and avoid the extra manual step.</p>
  
  <p>FYI: I already have update.py setup to only re-generate those files when needed, so if you run update.py multiple times it won't keep blindly changing gen.h, gen.cpp, etc.</p>
  
  <p>I have spent a huge amount of time trying to get this work (kinda embarrassing actually). I have been messing with QMAKE_EXTRA_TARGETS, QMAKE_EXTRA_COMPILERS, PRE_TARGETDEPS, etc, but nothing seems to quite work the way I want.</p>
  
  <p>Oh, some more info: gen.cpp and gen.h have QObject based classes, so I need them to gen generated before the MOC is run.</p>
  
  <p>Thanks!</p>