On 5 Dec 2011, at 5:11 PM, TomJones wrote:
> I've been reading through the developer docs and I'm not sure I can do what I 
> want so I thought I would ask. I have created a Foundation tool and   I have 
> created a private framework. All works great if I install my framework in 
> /Library/Frameworks. What I would like to know is, can I install my framework 
> in /usr/local/frameworks as an example and have my foundation tool 
> automatically find it? I would assume I would have to add a search path or 
> something but I'm not sure where.

If the framework will always be installed in /usr/local/frameworks, then this 
is easy enough: you can set the framework's install path to any path when it is 
built. When something is linked against that framework, the framework's install 
path is stored in the tool so that it can find the framework at runtime. There 
are some magic values you can use in the path to help out; see the end of the 
dyld man page:
   
http://developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/dyld.1.html

If you want the tool to search in multiple places at run time for the 
framework, that's harder. There are a couple of ways to arrange for that, but 
the easiest way is for the tool to actually live inside the framework (or at a 
known location relative to it), use the @executable_path or @rpath variable to 
find it, and in bin you can put either a symlink or a shell script to invoke 
the tool at its installed location. The shell script could alternately find the 
framework using whatever algorithm you like and then set DYLD_FRAMEWORK_PATH 
before invoking the real tool.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to