Adding project as dependency in XCode 4.x

XcodeDependencies

Xcode Problem Overview


With the revamp of XCode I am having a lot of trouble working out how to add make one xcodeproj dependent on another. It was hard enough to work out before but now I am just stuck.

If I drag lib.xcodeproj into app.xcodeproj it just shows up as an item in the project tree and I can't expand it or see build products for linking.

Can someone give me the correct sequence for adding lib.xcodeproj as a dependency to app.xcodeproj (ie it will build if necessary and link to app)

Xcode Solutions


Solution 1 - Xcode

Ahhh just worked out that the reason the lib project was being added as a useless non-expanding item was because I had the lib project open in another window. XCode gave me no indication that this was what the problem was, so I was lucky to stumble across it.

Once I had closed the other window I was able to add the lib project and it showed up correctly as an expandable subtree, as well as now being visible for selection in the app target dependencies.

Solution 2 - Xcode

The Xcode docs don't seem to be available online just now, so you'll have to search the documentation that came with Xcode for the following references. However, you'll find the information you're looking for under the following headings in Xcode Project Management Guide:

  • Managing Targets (Adding a Target Dependency)
  • Referencing Other Projects

Solution 3 - Xcode

check out BuildKit project https://github.com/davidmorford/BuildKit . It damatically reduce project dependency management effort.

Solution 4 - Xcode

Dont forget to add the path to Classes of the lib project to tell your project where to find Header find

  • Go to build settings, find "Header Search Path", enter full path to the Classes folder

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionintepidView Question on Stackoverflow
Solution 1 - XcodeintepidView Answer on Stackoverflow
Solution 2 - XcodeCalebView Answer on Stackoverflow
Solution 3 - XcodeCallin RimView Answer on Stackoverflow
Solution 4 - XcodehienntView Answer on Stackoverflow