1 # -------------------------------------------------------------------
2 # Set rpath for the application/library we're building
4 # See 'Tools/qmake/README' for an overview of the build system
5 # -------------------------------------------------------------------
7 equals(ROOT_BUILD_DIR, $$dirname(DESTDIR)): RPATHDIR_RELATIVE_TO_DESTDIR = ../lib
9 linux-*:!isEmpty(RPATHDIR_RELATIVE_TO_DESTDIR) {
10 # Do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR
11 # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var.
12 QMAKE_RPATHDIR = \$\$ORIGIN/$${RPATHDIR_RELATIVE_TO_DESTDIR} $${QMAKE_RPATHDIR}
13 RPATH = $$join(QMAKE_RPATHDIR, ":")
15 QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${RPATH}\'
18 QMAKE_RPATHDIR = $${ROOT_BUILD_DIR}/lib $${QMAKE_RPATHDIR}