Elliot Chance
Elliot Chance

Reputation: 5736

How do I get a build variable from xcodebuild?

I am using the following command:

xcodebuild -project eagle.xcodeproj -target eagle_test -showBuildSettings

But I need to extract the OBJROOT as part of an external makefile. How would I get this?

Upvotes: 5

Views: 2667

Answers (2)

The Lazy Coder
The Lazy Coder

Reputation: 11828

Her you go. Parsed all nicely.

xcodebuild -project eagle.xcodeproj -target eagle_test -showBuildSettings | grep "OBJROOT" | sed 's/[ ]*OBJROOT = //'

Upvotes: 4

ThomasW
ThomasW

Reputation: 17317

High level answer: As part of the makefile run the xcodebuild -project eagle.xcodeproj -target eagle_test -showBuildSettings command and parse the output for the value of OBJROOT.

Upvotes: 0

Related Questions