Creating Qt Xcode Projects from the Command Line

I play with Qt for several hours. I found that qmake creates Xcode project files on Mac OS X instead of good makefiles. I don't want to run Xcode every time I want to build "Hello, world".

How to get qmake to generate regular makefiles or, if something can't be done on a Mac, how do I compile .xcodeproj files from the command line?

I tried xcodebuild -project myProject -alltargets . I get a lot of results, followed by Abort trap .

+44
qt xcode makefile macos
Dec 18 '08 at 14:28
source share
4 answers

Trolltech's open source Qt binary installers for OS X by default create .xcodeproj files when qmake starts. I do not use Xcode for editing, so it hurts to open it to compile the project.

To compile your projects from Terminal.app, just set the QMAKESPEC environment variable in macx-g ++

If you just want to compile a specific project from the terminal, go to this directory and run

 qmake -spec macx-g++ 

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

+21
Dec 18 '08 at 17:43
source share
 $ man xcodebuild 

Thus, a typical command might be something like this:

 $ xcodebuild -project myProject.xcodeproj -alltargets 
+60
Dec 18 '08 at 15:05
source share

Try the following. It should work.

 xcodebuild -project myProject.xcodeproj -alltargets 

I used this method in most of my projects.

+2
Jan 17 '12 at 6:18
source share

Looking back at this part of your footprint:

# 2008-12-18 20: 40: 52.333 xcodebuild [1070: 613] [MT] FAULT MALFUNCTIONS in / SourceCache / DevToolsBase / DevToolsBase -921 / pbxcore / FileTypes / PBXCFBundleWrapperFileType.m: 174 # Details: the path must be empty but this is an empty line # Object: # Method: -subpathForWrapperPart: ofPath: withExtraFileProperties: # Subject: {name = (null), num = 1}

This means that something, possibly one of your configuration variables, is empty when you need to reference the file. I'm wondering, maybe you have an extra goal in your project that doesn't work, so creating with -alltargets is the cause of your problem.

I tested xcodebuild without any arguments in one of my projects just now - it made the default build of my project without errors. What happens if you try it without arguments?

0
Dec 18 '08 at 17:42
source share



All Articles