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
.
$ 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With