Xcode Project Dependencies and Linking

  • I see that in XCode I can drag a framework xcodeproj file into my
    application project and I can create a dependency.  This is pretty
    cool.  But is there a way to use the resulting framework built from
    the dependency in my linking phase?  I thought that maybe I could
    drag from the subproject to the frameworks group, but it doesn't
    allow this.

    Any ideas?

    Thanks,

    Lon
  • On Oct 11, 2006, at 5:39 PM, Lon Varscsak wrote:

    > I see that in XCode I can drag a framework xcodeproj file into my
    > application project and I can create a dependency.  This is pretty
    > cool.  But is there a way to use the resulting framework built from
    > the dependency in my linking phase?  I thought that maybe I could
    > drag from the subproject to the frameworks group, but it doesn't
    > allow this.

    There are no subprojects in Xcode, only cross-project references.
    This is important to remember, because it has a strong influence on
    how and why Xcode behaves as it does when building projects containing
    references to other projects.

    Now that that's cleared up, you should notice that the Products group
    for the project you dragged your framework project into has an entry
    for the framework.  Drag that - the framework product reference - into
    your app target's link phase and you'll be all set.

      -- Chris
  • Yes, thanks for the clarifcation on subprojects...I come from the land
    of Project Builder. :)

    Okay, so I see what your're saying now, and I _can_ drag the item to
    the "Link Binary With Libraries" group, but cannot drag it to the
    "External Frameworks and Libraries" group.  Is this intentional?  If
    so, why, and are there any consequences to dragging it directly to my
    linking phase rather than going through the framework list?

    Thanks,

    Lon

    On 10/12/06, Chris Hanson <cmh...> wrote:
    > On Oct 11, 2006, at 5:39 PM, Lon Varscsak wrote:
    >
    >> I see that in XCode I can drag a framework xcodeproj file into my
    >> application project and I can create a dependency.  This is pretty
    >> cool.  But is there a way to use the resulting framework built from
    >> the dependency in my linking phase?  I thought that maybe I could
    >> drag from the subproject to the frameworks group, but it doesn't
    >> allow this.
    >
    > There are no subprojects in Xcode, only cross-project references.
    > This is important to remember, because it has a strong influence on
    > how and why Xcode behaves as it does when building projects containing
    > references to other projects.
    >
    > Now that that's cleared up, you should notice that the Products group
    > for the project you dragged your framework project into has an entry
    > for the framework.  Drag that - the framework product reference - into
    > your app target's link phase and you'll be all set.
    >
    > -- Chris
    >
    >
    >
  • On Oct 13, 2006, at 10:39 AM, Lon Varscsak wrote:

    > Yes, thanks for the clarifcation on subprojects...I come from the land
    > of Project Builder. :)

    I assume you mean OPENSTEP ProjectBuilder... ;)

    > Okay, so I see what your're saying now, and I _can_ drag the item to
    > the "Link Binary With Libraries" group, but cannot drag it to the
    > "External Frameworks and Libraries" group.  Is this intentional?  If
    > so, why, and are there any consequences to dragging it directly to my
    > linking phase rather than going through the framework list?

    In Xcode, it's important to distinguish the kinds of items you're
    dealing with.  "External Frameworks and Libraries" is a group, but
    "Link Binary with Libraries" is not -- that's a build phase.  You can
    drag libraries and frameworks to that build phase to cause the phase's
    target to be linked against those libraries and frameworks.  The
    "External Frameworks and Libraries" group, on the other hand, is
    *just* an organizational construct, no different at all than any group
    you create by hand; the only difference is that it comes pre-created
    for you in the Xcode project templates.

    The one minor wrinkle in all of this is the "Products" group -- it
    *looks* like a regular group, but you can't remove things from it or
    move things around in it, because it's populated automatically by
    Xcode with the products that the project's targets build.  It's too
    bad there's no visual distinction to this group, to indicate that it's
    different than other groups.

      -- Chris
  • On 10/13/06, Chris Hanson <cmh...> wrote:
    > I assume you mean OPENSTEP ProjectBuilder... ;)

    Damn straight!  YellowBox for Windows to be more specific! :D

    Thanks for the info.  I wish there some documentation out there for
    "best practices with XCode".  I find that I'm struggling with the best
    way to organize my projects and have them all work together easily for
    multiple developers.

    -Lon
  • On Oct 13, 2006, at 12:16 PM, Lon Varscsak wrote:

    > Thanks for the info.  I wish there some documentation out there for
    > "best practices with XCode".  I find that I'm struggling with the best
    > way to organize my projects and have them all work together easily for
    > multiple developers.

    There are a number of books available on recent versions of Xcode now,
    in addition to Apple's documentation.  Fritz Anderson's "Step Into
    Xcode" and James Bucanek's "Beginning Xcode" come to mind immediately,
    and there are others as well.

      -- Chris
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today