Targets in Xcode

Hi, I'm new to these forums and I'm having a bit of trouble finding out if this was posted before, so I'll just ask. 😀

I am working on an iPhone application with a group of other developers. We rely on libraries managed by other teams in our project and would like to include their projects in our build.

We develop on both mac and Windows and in Visual Studio I can include svn external projects into my solution. When I build my solution, these targets are also built in the order of their dependencies. When I do svn updates these external projects are updated as well and the changes are reflected in our project.

I have tried a few different ways to emulate this behaviour in XCode but have had little luck finding a solution that works as well. I have tried dragging projects into our project, but this ignores the actual source when debugging. I also tried adding the files manually into a separate target. This worked fine until the external groups added or removed files which weren't reflected in our project. What we've settled on is opening each separate project manually and building each target for each configuration. This process is time consuming and prone to error when you forget a project or a config.

So, my question -after trial and error and scouring the nets- is this: can I use an externally managed library project as a fully sourced target in an existing XCode project?

Mac OS X (10.5.6)

Posted on May 13, 2009 12:20 PM

Reply
4 replies

May 13, 2009 12:50 PM in response to CountShockula

You're going to have to do two things. First, add an aggregate target to your project. An aggregate target builds multiple targets so you don't have to manually build each target separately. Choose Project > New Target to add a target to your project. The aggregate target is in the Other section under Mac OS X.

Second, add direct dependencies to your targets. A direct dependency is a target Xcode must build before it builds the current target. All of your other targets are going to be the aggregate target's direct dependencies. Your library target is going to be a direct dependency of your application's target. To add a direct dependency to a target, select the target from the Groups and Files list. Click the Info button in the project window toolbar to open the target's inspector. Click the General tab in the inspector to add direct dependencies.

May 13, 2009 2:33 PM in response to Mark Szymczyk

I'm not sure I phrased my question correctly. An aggregate will compile unrelated targets (or at least targets that are not directly dependent on each other). My libraries are direct dependencies of my application. I didn't have any issue assembling the dependency chain when I manually created the library targets. The issue is that if I manually create the targets I must also manage the changes (add, remove, etc) of a codebase I don't work on.

The situation is that I have two separate projects; one I manage and one that the library team manages. I would like to use their entire project as a target within my project so that I can leave the management up to them as I do in Visual Studio.

Message was edited by: CountShockula

May 14, 2009 7:24 AM in response to K T

That link does help in that it pretty much cements the fact that I can't actually do what I want using built-in XCode functionality 😟

Since the source of the libraries isn't actually included in a meaningful way we can't navigate it when trying to understand the code or during debugging.

I think I'll still implement the cross-project referencing. I was doing this before, but was hoping to improve the situation.

Thanks for your help folks, I really appreciate the quick responses.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Targets in Xcode

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.