Xcode: project settings vs. target settings

vectorizor picture vectorizor · Oct 29, 2009 · Viewed 16.3k times · Source

I'm creating a static lib on Mac OS X for one of our customers, as well as a small cmd line app to test the static lib. The cmd line project has 2 extra library search paths, which meant I was linking to the Debug version in Release mode and just about went crazy, so I tried to get rid of these two paths, but I couldn't find where they were specified. I was looking in the project info, but it turns out they were specified in the target info.

I don't understand the distinction?! Why there are 2 sets of settings, which are essentially the same?! Can someone please enlighten me?

Answer

iKenndac picture iKenndac · Oct 29, 2009

A project can contain multiple targets. For example, an app I write has four - the app itself, a Quick Look plugin, a framework and a bundle that contains Mac OS 10.6-specific functionality that can be dynamically loaded in.

Project settings apply to every single target in the project. Each target can then override individual settings if they need to - for instance, my project's Target SDK is set to 10.5, but the 10.6-specific bundle has it's Target SDK set to 10.6.

In some instances, some settings don't make sense to be in Project Settings - one of these, I guess, is search paths.