• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do I copy Build Configuration-specific frameworks into my app bundle?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I copy Build Configuration-specific frameworks into my app bundle?


  • Subject: Re: How do I copy Build Configuration-specific frameworks into my app bundle?
  • From: Fritz Anderson <email@hidden>
  • Date: Mon, 18 Jul 2005 09:44:01 -0500

A dynamic library in Mac OS X carries its installation path inside the library. Linking an application that uses that library records the installation path in the application. You can't just move a framework into the Frameworks folder of the application bundle; the library has to be built with the installation path in it, and the application has to be linked against that version of the library.

So build the framework with the installation path "@executable_path/../Frameworks", and when building the application use a Copy Files phase to move the product of the framework-build target to the Frameworks folder.

This is just an overview. For the full instructions, see <http:// developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/ Tasks/InstallingFrameworks.html>
and
<http://developer.apple.com/documentation/MacOSX/Conceptual/ BPFrameworks/Tasks/CreatingFrameworks.html#//apple_ref/doc/uid/ 20002258-106880-BAJJBIEF>


There is also an excellent tutorial at <http://rentzsch.com/share/ embeddingFrameworks.mov>.

If you follow this procedure, the configuration-specific build of the framework will be matched to the corresponding application build.

    -- F

On 18 Jul 2005, at 3:56 AM, Jesper Papmehl wrote:

Hi!

I build some frameworks and then an app that uses those frameworks using Xcode 2.1.

I build the app and each framework in debug and release flavors. When building the release version of the app, I want to use the release versions of the frameworks, and when building the debug version I want to use the debugging frameworks.

I put each version of the frameworks into their own subfolders. I have managed to get the app to link to the correct version of the frameworks by setting Framework Search Paths differently for each Build Configuration.

However, I get into trouble when trying to copy the frameworks into the Contents/Frameworks folder of my app bundle. Since I haven't been able to find an automatic function for this (copy this framework that I link to into the app bundle), I tried using a Copy Files Build Phase. However, it seems only to be possible to refer to a file by it's name, not by it's path, so I can't get Xcode to copy different files when using different build styles.

Do I really have to resort to a Run Shell Script Build Phase? If so, what environment variable do I need to use to get the path to the app bundle being built? I haven't been able to find a single one that will give me that, do I have to build the path myself using several variables?


TIA

/Jesper Papmehl
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40manoverboard.org


This email sent to email@hidden



_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >How do I copy Build Configuration-specific frameworks into my app bundle? (From: Jesper Papmehl <email@hidden>)

  • Prev by Date: Re: Universal Binary that runs on 10.3.x and up on PPC and 10.4.1 and up on Intel
  • Next by Date: Detecting installed Xcode version
  • Previous by thread: How do I copy Build Configuration-specific frameworks into my app bundle?
  • Next by thread: Detecting installed Xcode version
  • Index(es):
    • Date
    • Thread