Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use a relative path in Xcode project settings?

How do I use a relative path in Xcode project settings?

like image 592
Shay Avatar asked Sep 13 '09 05:09

Shay


People also ask

How do you specify a relative path?

Relative paths make use of two special symbols, a dot (.) and a double-dot (..), which translate into the current directory and the parent directory. Double dots are used for moving up in the hierarchy. A single dot represents the current directory itself.

How do you use absolute and relative paths?

An absolute path is defined as specifying the location of a file or directory from the root directory(/). In other words,we can say that an absolute path is a complete path from start of actual file system from / directory. Relative path is defined as the path related to the present working directly(pwd).

When would you use a relative path vs an absolute path?

In simple words, an absolute path refers to the same location in a file system relative to the root directory, whereas a relative path points to a specific location in a file system relative to the current directory you are working on.


2 Answers

All paths in Build Settings are assumed relative to the directory that contains the .xcodeproj file. Use the standard Unix path tokens

.   project directory ..  parent directory 

So if your project file is trunk/Mac/proj.xcodeproj, and your headers are in trunk/Headers/foo.h, you would add ../Headers to your Header Search Paths.

like image 77
cdespinosa Avatar answered Nov 11 '22 00:11

cdespinosa


Also there are two paths: $SRCROOT and $SDKROOT.

like image 25
Mike Chen Avatar answered Nov 11 '22 00:11

Mike Chen