From 49f670fe9642e54f9102d920d0e298b45b33e89c Mon Sep 17 00:00:00 2001 From: Felix Kauselmann <2039670+selmf@users.noreply.github.com> Date: Sat, 13 Jan 2018 10:05:27 +0100 Subject: [PATCH] Improve qmake checks for pdf backends (poppler, pdfium, pkg-config fallback) --- dependencies/pdf_backend.pri | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/dependencies/pdf_backend.pri b/dependencies/pdf_backend.pri index d657972b..f0f9e4e6 100644 --- a/dependencies/pdf_backend.pri +++ b/dependencies/pdf_backend.pri @@ -18,11 +18,11 @@ CONFIG(pdfium) { LIBS += -L$$PWD/pdfium/macx/bin -lpdfium INCLUDEPATH += $$PWD/pdfium/macx/include } - else:!macx:packagesExist(libpdfium) { - message(Using system provided installation of libpdfium.) + else:!contains(QT_CONFIG, no-pkg-config):packagesExist(libpdfium) { + message(Using system provided installation of libpdfium found by pkg-config.) CONFIG += link_pkgconfig PKGCONFIG += libpdfium - } else:!macx:exists(/usr/include/pdfium):exists(/usr/lib/libpdfium.so) { + } else:exists(/usr/include/pdfium):exists(/usr/lib/libpdfium.so) { message(Using libpdfium found at /usr/lib/pdfium) INCLUDEPATH += /usr/include/pdfium LIBS += -L/usr/lib/pdfium -lpdfium @@ -54,13 +54,18 @@ CONFIG(poppler) { LIBS += -L$$PWD/poppler/dependencies/bin } unix:!macx { - packagesExist(poppler-qt5) { + !contains(QT_CONFIG, no-pkg-config):packagesExist(poppler-qt5) { + message("Using system provided installation of poppler-qt5 found by pkg-config.") CONFIG += link_pkgconfig PKGCONFIG += poppler-qt5 - } else { + } else:!macx:exists(/usr/include/poppler/qt5):exists(/usr/lib/libpoppler-qt5) { + message("Using system provided installation of poppler-qt5.") INCLUDEPATH += /usr/include/poppler/qt5 LIBS += -L/usr/lib -lpoppler-qt5 + } else { + error("Could not find poppler-qt5") } + } unix:macx { error (Poppler backend is currently not supported on macOS)