My Mac OS application links with a non-system-provided framework Foo.framework. I added a reference to the framework in XCode and the app builds fine. I also have a rule which copies the framework into the output Frameworks folder (MyApp.app/Contents/Frameworks). However, at runtime the binary is looking for the framework in ~/Library/Frameworks and the app fails to load.
otool -l MyApp.app also tells me that it's looking for the framework in /Users//Library/Frameworks.
Can someone explain why this happens, and what the right way to make the app look in the application bundle's Frameworks folder is?
My hacky workaround is to include a custom script to change the path in the mach-o binary using install_name_tool, but I'm sure there is a clean way of doing this.