views:

346

answers:

1

Is it possible to have multiple projects in one xcode project all accessible for simultaneous development?

Specific situation is to have an application and middleware library under simultaneous development in XCode: all source is accessible for modification (both app's and lib's) but library code is building into library and linking to the app on its own build.

Visual Studio handles it with solution and projects inside, dependencies between them and build order.

What are the steps to get as closer to such behavior as possible?

+3  A: 

An Xcode project can contain other Xcode projects, so you can set up a top level Xcode project to simulate a VS solution file. It's not a perfect match; for instance, there's no Find in Files command that will act across all the sub-projects, though you can set up custom searches that will do the equivalent for you. However, you can tell the top level project to build, and it will build all the sub-projects.

To do this, start by creating an empty project: File > New > Empty Project.

Then add a target to it by right clicking the Targets icon and selecting Add > New Target... > Aggregate.

Now start adding your library projects to the empty project: right click the project icon, and select Add > Existing Files..., then navigate to your .Xcode project file.

Charles Anderson
mm..I can't figure out how to make top-level project. I tried creating empty project and adding my lib.xcodeproj and app.xcodeproj into it but they are just showing as products (liblib.a and app.app) - no code, no targets and thus no build for top-level project. Did I do something wrong?
Anton
Sorry, it was a while since I did this. I've expanded my answer a bit. The key is to create an Aggregate target to add the sub-projects to.
Charles Anderson
You can also use the Target Info window to add dependencies:1. Open the info window for the target2. Select the General tab and click the + button under the Direct Dependencies box3. Select the target you want to include from the subproject.If you build the aggregate and something's changed in the dependency target, the dependency will get built as well.
Jablair