Building Qt Xcode Projects From the Command Line Building Qt Xcode Projects From the Command Line xcode xcode

Building Qt Xcode Projects From the Command Line


$ man xcodebuild

So a typical command might be something like:

$ xcodebuild -project myProject.xcodeproj -alltargets


The open-source Qt binary installers for OS X from Trolltech default to creating .xcodeproj files when you run qmake. I don't use XCode for editing so it is a pain to open it to compile the project.

To compile your projects from Terminal.app, just set an environment variable of QMAKESPEC to macx-g++

If you want to just compile a certain project from the terminal, go into that directory and run

qmake -spec macx-g++

When you run qmake, this will create a Makefile which you can use by running make.


Try the following way. It has to work.

xcodebuild -project myProject.xcodeproj -alltargets

I have used this method in most of my projects.