[Solved] [How?] Generate moc files automatically using Visual Studio 2008
-
Hello guys
I have a simple question. :)
Is there some way to configure Microsoft Visual Studio 2008 to automatically generate and use moc files every time I add the Q_OBJECT macro in a class? Right now this is done when I create my Visual Studio project as a "Qt Application" but not when I have a simple 'Win32 Project' or 'Win32 Console Application'. What project properties I should add to the last two types of projects, in order to generate automatically the moc files?Thank you in Advance!
-
Can you say why you don't want to use Qt App projec template? Are there any reasons for it?
-
Heya,
Thank you for your reply dude. Well, there is no any very serious reason for it. I just want to know how to do it without the Qt Application project template.Cheers
[quote author="Denis Kormalev" date="1305117479"]Can you say why you don't want to use Qt App projec template? Are there any reasons for it? [/quote]
-
You can add some preparation and compilation steps manually. There is no help from other tools.
Just go with a Qt project and you're done.
You can always analyze a VS project file with Qt support enabled. It's just an XML file.
-
Thanks for your reply Volker.
Indeed I found a guide explaining how to configure the project settings for the thing I ask. Although, I might have a look at the project files when I find some free time to see how the Qt App template works.
Thanks again for your help guys! -
I've never done that manually, but always used the VS addin for the "dirty work" (I'm lazy regarding such stuff :) )
-
And it is really dirty, as you have to deal with all the compiler defines etc.
You can also just add some xml stuff in thge end of the vcproj file and the plugin does all for you, even if it was not created with the qt templates.