0

I'm trying to get Visual Studio 2010 to execute a FOR loop - just like the ones that can be done in a .bat file - as a pre-build event command... No luck this far.

Long story short, I'm trying to get Qt's moc.exe to iterate on all my header files at build time. If this work, another thing to achieve would be to include the generated moc_*.cpp files in the build process, but I'm not quite there right now.

Any idea ? Thanks a lot !

xtrium
  • 64
  • 6
  • 1
    Are you just trying to get Qt project build in Visual Studio? [Qt Visual Studio Add-in](http://qt.nokia.com/downloads/visual-studio-add-in) does all this preprocessing automatically. – jirkamat Jul 29 '11 at 10:54

1 Answers1

0

Anyway you have to write msbuild script target for this and run as BeforeBuild target of project.

When you build a project that contains several files, you can list each file separately in the project file, or you can use wildcards to include all the files in one directory or a nested set of directories.

See more here How to: Select the Files to Build

sll
  • 61,540
  • 22
  • 104
  • 156
  • Thanks for your answer :) Using MSbuild here seemed a bit overkill to me, though. I got that to work (the doc pages _really_ should mention that the % sign needs to be escaped by typing it twice...) Now I have to integrate those cpp files in the compilation process. – xtrium Jul 29 '11 at 10:25