1

I have an C++ application, which consists of several VS2010 projects and two Qt Creator projects (for the GUI).

I would like to have a build script, which builds all the projects at once. So what would be the best tool for the job?

BenMorel
  • 34,448
  • 50
  • 182
  • 322
Simon
  • 1,616
  • 2
  • 17
  • 39

1 Answers1

2

Personally, I would change all projects to Qt projects and assemble them using the SUBDIRS template for .pro files.

You could then either run qmake on the top-level .pro file or do

qmake -tp vc -recursive

to create a VS solution and .vcproj files.

If that is not an option, you could just write a batch script which compiles them all. For VS 2008 I had batch scripts like this (File existence checks, error code handling etc omitted):

"%VS90COMNTOOLS%vsvars32.bat"
cd GUI
qmake GUI.pro
cd ..\Core
call vcbuild core.sln "Release|Win32" 

The first is needed so vcbuild and nmake etc are known. It could be VS100COMNTOOLS or something like that for VS 2010, you may check your environment variables for that. Or maybe it's not even needed anymore.

Tim Meyer
  • 12,210
  • 8
  • 64
  • 97
  • At the moment, changing the projects to Qt is not an option. I was thinking about writing a batch file, however I wonder, if there's a more sophisticated solution. – Simon Jul 13 '12 at 08:45
  • I don't know of anything easier unless all projects are either Qt or VS – Tim Meyer Jul 13 '12 at 08:46
  • That's what I thought :-/. I just realized it should be "devenv core.sln /build "Release|Win32" " to build a solution. VS100COMNTOOLS works for VS2010. – Simon Jul 13 '12 at 09:04