Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode -- how do I set $(SRCRoot)?

Tags:

xcode

I am working with someone's library . . . they have set $(SRCRoot) to the location the library was in on their computer. On my computer, it is in a different location. This is messing everything up. How do I change it?

like image 836
William Jockusch Avatar asked Sep 16 '10 19:09

William Jockusch


4 Answers

You must define SRCRoot, not $(...), because the $(x) command returns the value stored in x.

like image 125
Alexsander Akers Avatar answered Nov 16 '22 07:11

Alexsander Akers


SRCROOT, like any Xcode build variable, is set in the Build options in the Target settings. However, setting SRCROOT is not supported through the interface options (because you shouldn't set it manually in the first place), so it'll fall under "User-Defined" settings if someone set it manually. You'll want to select it and then delete it. Here's a picture to demonstrate: alt text

like image 34
mipadi Avatar answered Nov 16 '22 08:11

mipadi


SRCRoot is one of the default variables of Xcode

The best source is probably Apple's official documentation

like image 3
xhan Avatar answered Nov 16 '22 08:11

xhan


Adding a custom user setting (SRCROOT) will work only partially. If your project is under source control you may find that source files are marked red - i.e. Xcode cannot locate them.

Simply open up the project file into a text editor and replace all occurrences of the old source code folder name.

Works fine.

like image 1
Konstantinos Kontos Avatar answered Nov 16 '22 08:11

Konstantinos Kontos