How to install $ (SRCRoot)?

I work with some kind of library., They installed $ (SRCRoot) in the place where the library was installed on their computer. On my computer, it is located elsewhere. It ruined everything. How to change it?

+4
source share
5 answers

SRCROOT , like any Xcode build variable, is set in the Build parameters in the Target settings. However, installing SRCROOT not supported through the interface settings (because you should not install it manually in the first place), so it will fall under the β€œCustom” settings if someone installs it manually. You will want to select it and then delete. Here is an image to demonstrate: alt text

+3
source

SRCRoot is one of the standard Xcode variables

The best source is probably Apple's official documentation

+3
source

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

+1
source

Adding custom settings (SRCROOT) will only work partially. If your project is under source control, you may find that the source files are marked in red - that is, Xcode cannot find them.

Just open the project file in a text editor and replace all occurrences of the old source folder folder name.

It works great.

+1
source

These answers are all on a rather old side, so I would like to provide something current like Xcode 7.3.1.

I needed to change the SRCROOT location for my workspace due to some external folders. This was done by moving .xcworkspace and .xcodeproj to a new location. After that, I just needed to update a few elements:

  • All files inside my project
  • Search path for the Framework (as configured by the assembly / Framework search path)
  • The location of my info.plist file (in the build settings /, info.plist file)

Your mileage may vary depending on other items that you may have, but this should cover the basics.

0
source

All Articles