Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to acquire the workspace path in Xcode 4 via an environment variable

Tags:

xcode

xcode4

I can't find anything workspace related in the Xcode Build Setting Reference.

Essentially I need something like $(WORKSPACE_DIR). If Xcode doesn't provide it, is there any way to define a custom user variable that could somehow accurately provide the workspace path in the event that the working workspace were to move (think branches etc)?

like image 418
Brian Lawson Avatar asked Dec 28 '11 16:12

Brian Lawson


1 Answers

If your workspace is set up like:

//bla/bla/bla/workspace/{project directories}* 

then you can use

$(SRCROOT)/../

to get the workspace directory from a give project directory.


For example, if you want to have one project reference headers in another project:

Project Build Settings->User Header Search Paths => $(SRCROOT)/../SomeLibProj

(and set it to 'recursive' if you don't want to add every folder)

like image 70
Sogger Avatar answered Oct 19 '22 23:10

Sogger