bin/qmake ${OE_QMAKE_DEBUG_OUTPUT} ${S} -o Makefile || die "Configuring qt with qmake failed. EXTRA_OECONF was ${EXTRA_OECONF}"
}
+# Set the EXTRA_QTLIB variable to e.g. Xml, in order to not remove libQt5Xml.so.*
+EXTRA_QTLIB ?= ""
+
+python __anonymous () {
+ templibs = ""
+ for e in d.getVar("EXTRA_QTLIB", True).split():
+ templibs = "%s -not -name 'libQt5%s.so*' -and" % (templibs, e)
+ d.setVar("QTLIBSPRESERVE", templibs)
+}
+
do_install() {
# Fix install paths for all
find -name "Makefile*" | xargs sed -i "s,(INSTALL_ROOT)${STAGING_DIR_NATIVE}${STAGING_DIR_NATIVE},(INSTALL_ROOT)${STAGING_DIR_NATIVE},g"
${D}${libdir}/pkgconfig
find ${D}${libdir} -maxdepth 1 -name 'lib*' -and \
-not -name 'libQt5Core.so*' -and \
+ ${QTLIBSPRESERVE} \
-not -name 'libQt5Bootstrap.a' \
-exec rm '{}' ';'
}