[Qt-interest] Linux Deployment using rpath and $ORIGIN

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Mon Dec 13 11:39:56 CET 2010


On 2010-12-13 ITS-CMT-SUI-SL-SFR-FIN-DEV Knoll Oliver, ITS-CMT-SUI-SL-SFR-FIN-DEV wrote:

> ...
> For a given library:
> 
>   macx {
>     QMAKE_LFLAGS_SONAME = -Wl,-
>     install_name, at executable_path/../Frameworks/
>     DESTDIR = $$PWD/../bin/$${APP_NAME}.app/Contents/Frameworks
>   }
>   
>   !macx {
>     CONFIG += plugin
>   }
> where APP_NAME is the name of the application (my own defined variable)
> respective the <APP_NAME>.app bundle. That is @executable_path../Frameworks
> is set as the "library identifier" and the library is copied into

Just for completeness sake: the above lines are for dynamic libraries, but for the actual executable there is no further action required. It seems that on Mac the "@executable_path/../Frameworks" is the default for all executables, or qmake makes sure that "install_name_tool -change" is called properly upon the generated executable (http://doc.trolltech.com/4.7/deployment-mac.html).

So with a few extra lines in the *.pro file for the library I am able to generate "application bundles with (my own) library dependencies" with a simple

  qmake
  make

that is without any shell scripts calling install_name_tool etc. :)

(The next step would then involve deploying the Qt Frameworks, e.g. by using the http://doc.trolltech.com/4.7/deployment-mac.html#the-mac-deployment-tool)


Cheers, Oliver
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22






More information about the Qt-interest-old mailing list