Fix missing libraries of an existing Mac OS binary by adding a correct @rpath command

Adding missing library path to an existing OS X binary: For example: open tracker (see https://github.com/opentrack/opentrack) misses the correct relative @rpath: otool -l /Applications/opentrack.app/Contents/MacOS/opentrack.bin | grep @rpath name @rpath/QtWidgets.framework/Versions/5/QtWidgets (offset 24) name @rpath/QtGui.framework/Versions/5/QtGui (offset 24) name @rpath/QtNetwork.framework/Versions/5/QtNetwork (offset 24) name @rpath/QtCore.framework/Versions/5/QtCore (offset 24) Where @rpath is at: Load command 28 cmd LC_RPATH cmdsize 56 path /Users/sthalik/dev/opentrack/build/install (offset 12) Load command 29 cmd LC_RPATH cmdsize 56 path /Users/sthalik/Qt5.5.1/5.5/clang_64/lib (offset 12) Wrong path set for local Qt's libraries In order to fix this: we should add a custom @rpath for all libraries not being deployed with the executable or being linked with libs…

1 Comment