I've been playing around with Qt for a few hours now. I found that qmake produces Xcode project files on Mac OS X instead of good ol' makefiles. I don't want to launch Xcode every time I want to build "Hello, world".
How do I make qmake generate regular makefiles or, if that's something that cannot be done on the Mac, how do I compile .xcodeproj
files from the command line?
I tried xcodebuild -project myProject -alltargets
. I get a lot of output followed by Abort trap
.
So a typical command might be something like:
Looking at this part of your back trace:
This implies that something, maybe one of your configuration variables, is blank when it needs to refer to a file. What I'm wondering is if maybe you have an extra target in your project that doesn't work, so that building with -alltargets is what's causing your problem.
I tested xcodebuild without any arguments on one of my projects just now - it did a default build of my project without errors. What happens if you try it without arguments?
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
When you run qmake, this will create a Makefile which you can use by running make.
Try the following way. It has to work.
I have used this method in most of my projects.