Reputation: 27335
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?
Upvotes: 7
Views: 18745
Reputation: 36660
These answers are all on the fairly old side, so I wanted to provide something current as of Xcode 7.3.1.
I needed to change the location of the SRCROOT for my Workspace due to some external folders. This was done by moving the .xcworkspace and .xcodeproj to the new location. After that, I just had to update a few items:
Your mileage may vary based on other items you may have, but this should cover the basics.
Upvotes: 0
Reputation: 140
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.
Upvotes: 1
Reputation: 6297
SRCRoot is one of the default variables of Xcode
The best source is probably Apple's official documentation
Upvotes: 3
Reputation: 411082
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:
Upvotes: 4
Reputation: 16024
You must define SRCRoot
, not $(...)
, because the $(x)
command returns the value stored in x
.
Upvotes: 4