Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Install dependent libraries in qmake .pro file



  • Hi,
    I struggle to place binary and dependent libraries in one folder. For most cases I successfully provided relative paths in target.files. But this is brittle. Especially when dependent library builds other project.

    I would like to have some automatic mechanism to copy libraries on which my app depend.
    In Run section of kit configuration there's Add build library search path to LD_LIBRARY_PATH. I confirmed that QProcessEnvironment::systemEnvironment() returns LD_LIBRARY_PATH with those paths.

    How to do it?


  • Moderators

    @Sebastian-Mosiej said in Install dependent libraries in qmake .pro file:

    How to do it?

    Just use rpath when linking your project.

    Or - probably better approach - deploy your app using linuxdeployqt, or flatpak, snap, DEB or RPM. This way the "heavy lifting" is already done for you and your users will be familiar with the way the app runs, links and works.


Log in to reply