PDA

View Full Version : QT precompilation with XCode



Shadowbadger
23rd November 2009, 17:46
I am currently working on a QT C++ project and have been able to get it to compile using the following steps:

Place all my .h and .cpp files in the directory MyProject
Run make clean (obviously not on the first go)
Create the QT project file using qmake -project
Do the QT precompilation (qmake -spec macx-g++ && qmake)
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.


#/bin/bash
make clean
qmake -project
echo "QT += network" >> MyProject.pro
qmake -spec macx-g++
qmake
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 generates .moc files 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.

Thanks in advance.