66

I just switched over to Xcode 4 and I'm having trouble working with .xcconfig files for build settings. My targets that already had files assigned in Xcode 3 are all set up - a column titled Config.file shows up in the Levels view of Build Settings. But I can't figure out how to edit the columns in this view or where to put an .xcconfig file to attach it to a new target. I've looked online and haven't found an answer. Anybody know how to do this?

Cole Tobin
  • 9,206
  • 15
  • 49
  • 74
Luke
  • 7,110
  • 6
  • 45
  • 74

2 Answers2

109

Pick File | New, choose Other and "Configuration Settings File", this gets you a new .xcconfig file.

Then click on the project on the upper left in the file browser (the same place where you get to build settings), click on the project again in the second-to-left panel, and click on the Info tab at the top of the inner panel.

There, you can choose "Based on Configuration File" for each of your targets for each of your configurations (debug, release, etc.)

starball
  • 20,030
  • 7
  • 43
  • 238
Mike Kale
  • 4,103
  • 3
  • 26
  • 30
58

Great answer from Mike Kale. If the description was not clear enough, here is a screenshot.

xcconfig in the project configuration

allprog
  • 16,540
  • 9
  • 56
  • 97
  • one thing i don't understand is this: when you copy over a config file to the project.. you get prompted to click on each project that you wish the config file to apply to.. but then in the above screenshot.. there is a dropdown beside the project file *and* a dropdown beside *each* target.. so if I selected all targets in the first step.. so i still have to assign it to each target drop down menu? – abbood May 03 '14 at 08:05
  • 1
    the answer is the latter (ie you still have to assign the config file for *each* target..) – abbood May 03 '14 at 08:09