I am currently working on a QT C++ project and have been able to get it to compile using the following steps:

  1. Place all my .h and .cpp files in the directory MyProject
  2. Run make clean (obviously not on the first go)
  3. Create the QT project file using qmake -project
  4. Do the QT precompilation (qmake -spec macx-g++ && qmake)
  5. Open the .xcodeproj file then build and run.

I have wrapped this in a shel script which I can run and do it all at once.

make clean
qmake -project
echo "QT += network" >> MyProject.pro
qmake -spec macx-g++
# Now open the .proj file and build with xcode
Now whilst all of this works fine it involves creating a new XCode project each time (losing any of my project settings) and because qmake sets up some linking and generates .moc files used by QT for its Signals/Slots functionality I need to run it pretty much every time I create a new class.

My question is does anyone know of another way to do this? I need to generate all the temporary files used by QT, setup the XCode project in the same way (with all libraries and settings) but without having to redo the whole thing. As I say I think there are some linker options being set and I am looking into those but in case there is some standard or obvious method I am missing I figured I would post now as well.

Thanks in advance.