You can create a dynamic structure in Mac OS X. In your dynamic structure, you can set LD_DYLIB_INSTALL_NAME as @ rpath / Foo.framework / Versions / A / Foo
If you have an application that wants to link this framework, make sure you run
install_name_tool -add_rpath <rpath> <full-path-to-app-binary>
So if I have Foo.app
install_name_tool -add_rpath Foo.app/Contents/Library Foo.app/Contents/MacOS/Foo
Now, if you just copy Foo.framework to the Contents / Library, it should load, and everything should work.
Hope this helps.
It would probably be easier to use a static library with public headers. When you create a static library, you can automatically copy the headers for Xcode. And for your purpose, you can add a folder to your search path.
If you use a static library, Xcode will remove some dead code that you really don't need, but compiled into a static lib.
dimitrirostavo
source share