Commit df5c5549 authored by Pino Toscano's avatar Pino Toscano Committed by Philipp Erhardt
Browse files

First support for building with Qt5

When the Qt version is greater than 4 (so 5 at least), require the
QtWidgets module as well, which is where QWidget-based stuff lives.
Temporarily enable deprecated methods in Qt5, so there are no code
changes required.

Also pick the right poppler version, poppler-qt4 for Qt4 and
poppler-qt5 for Qt5, including the right header depending on the
version.

These changes allow katarakt to build and link, and it seems to be
working fine at a quick glance.
parent 363c988c
......@@ -5,12 +5,19 @@ INCLUDEPATH += .
CONFIG += qt
QT += network xml dbus
greaterThan(QT_MAJOR_VERSION, 4) {
QT += widgets
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
}
POPPLER = poppler-qt$$QT_MAJOR_VERSION
DEFINES += POPPLER_QT=$$QT_MAJOR_VERSION
unix {
CONFIG += link_pkgconfig
PKGCONFIG += poppler-qt4
PKGCONFIG += $$POPPLER
isEmpty(PKG_CONFIG):PKG_CONFIG = pkg-config # same as in link_pkgconfig.prf
POPPLER_VERSION = $$system($$PKG_CONFIG --modversion poppler-qt4)
POPPLER_VERSION = $$system($$PKG_CONFIG --modversion $$POPPLER)
POPPLER_VERSION_MAJOR = $$system(echo "$$POPPLER_VERSION" | cut -d . -f 1)
POPPLER_VERSION_MINOR = $$system(echo "$$POPPLER_VERSION" | cut -d . -f 2)
POPPLER_VERSION_MICRO = $$system(echo "$$POPPLER_VERSION" | cut -d . -f 3)
......
......@@ -3,7 +3,11 @@
#include <QImage>
#include <QMutex>
#if POPPLER_QT >= 5
#include <poppler-qt5.h>
#else
#include <poppler-qt4.h>
#endif
class SelectionLine;
......
......@@ -4,7 +4,11 @@
#include <QPainter>
#include <QList>
#include <QClipboard>
#if POPPLER_QT >= 5
#include <poppler-qt5.h>
#else
#include <poppler-qt4.h>
#endif
#include <map>
#include "../selection.h"
......
#ifndef RESOURCEMANAGER_H
#define RESOURCEMANAGER_H
#if POPPLER_QT >= 5
#include <poppler-qt5.h>
#else
#include <poppler-qt4.h>
#endif
#include <QObject>
#include <QString>
#include <QImage>
......
#ifndef SEARCH_H
#define SEARCH_H
#if POPPLER_QT >= 5
#include <poppler-qt5.h>
#else
#include <poppler-qt4.h>
#endif
#include <QString>
#include <QThread>
#include <QMutex>
......
#ifndef SELECTIONPART_H
#define SELECTIONPART_H
#if POPPLER_QT >= 5
#include <poppler-qt5.h>
#else
#include <poppler-qt4.h>
#endif
#include <QRectF>
......
......@@ -7,7 +7,11 @@
#include "config.h"
#include <list>
#include <iostream>
#if POPPLER_QT >= 5
#include <poppler-qt5.h>
#else
#include <poppler-qt4.h>
#endif
using namespace std;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment