[CMake] Help with fixup_bundle for Mac OS - @executable_path, @loader_path, @rpath

Scott Fowler s.fowler at tecplot.com
Tue Feb 1 11:39:08 EST 2011


I have an application "Foo" which distributes a plugin for a separate application "Bar".  My plugin is dependent on libraries distributed with application "Foo".  When application "Bar" tries to load the plugin, the plugin will not load, as it cannot find the libraries distributed with "Foo".

As far as I can tell this boils down to the @executable_path reference which fixup_bundle inserts into my binaries.

>otool -L plugin.dylib
@executable_path/../MacOS/libsomedependency.dylib
@executable_path/../MacOS/libsomeotherdependency.dylib
etc...

When application "Bar" loads my plugin, I'm assuming that @executable_path resolves to the location of "Bar", but the plugin's dependent libraries are in Foo.app/Contents/MacOS, not in Bar.app/Contents/MacOS.

All this leads me to believe that I should be using @loader_path or @rpath instead, but I don't see a way to do this using CMake as it appears that BundleUtilities.cmake and GetPrerequisites.cmake are hardcoded to use @executable_path.

Any advice would be greatly appreciated.

Thanks!
Scott

________________________________
This e-mail and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom they are addressed. If you are NOT the intended recipient or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error and that any use, dissemination, forwarding, printing or copying this e-mail is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110201/2d1bf8ea/attachment.htm>


More information about the CMake mailing list