[Qt-interest] Qt open source and VS 2008... how to make it work?

Ender EREL erelender at yahoo.com
Fri Feb 19 14:55:18 CET 2010


Oliver.Knoll at comit.ch wrote:
...
> Disadvante of the later (Visual Studio): it is a pain to manually update the post-build steps! But doable... and the advantage is that e.g. it is very easy to set dependencies between projects (e.g. your *.exe and *.dll(s)), the header dependencies are automagically set (so when you change a header the dependent projects get re-build as well etc.)
...

This made me think a minute ago. Here is my train of thought:

- Can i adjust a file's pre-build event in project's pre-build event?
- Hmm, i think not.
- But i can adjust a batch file, right?
- Wait, I don't need to adjust a batch file, why would i need to?

And here's where i arrived:

Create a batch file that takes some parameters like project include 
directories, configuration name vs. and set it as a pre-build event to 
the project. This batch file iterates over .h and .ui files in the 
project dir & subdirs (except ./GeneratedFiles), searches the .h files 
for Q_OBJECT macro and runs moc on them if finds it. Writing the batch 
file may be cumbersome and may fail on some occasions (like files 
outside project dir) but for most projects this should be enough, 
shouldn't it?

-- 
Ender EREL



More information about the Qt-interest-old mailing list