summaryrefslogtreecommitdiff
path: root/liblightdm-qt
diff options
context:
space:
mode:
authorMichael Terry <michael.terry@canonical.com>2013-02-06 09:08:25 -0500
committerMichael Terry <michael.terry@canonical.com>2013-02-06 09:08:25 -0500
commit588dbaa9e33aba0bf5b4af6bd33f06176d643832 (patch)
treec38b618fd4827f4fd530fc4722343c9e2292f002 /liblightdm-qt
parentc9d9437b5d804dcec27337bc5fa6c40d23f719df (diff)
downloadlightdm-588dbaa9e33aba0bf5b4af6bd33f06176d643832.tar.gz
initial build support for Qt5
Diffstat (limited to 'liblightdm-qt')
-rw-r--r--liblightdm-qt/Makefile.am64
-rw-r--r--liblightdm-qt/greeter.cpp6
-rw-r--r--liblightdm-qt/liblightdm-qt-2.pc.in2
-rw-r--r--liblightdm-qt/liblightdm-qt5-2.pc.in11
-rw-r--r--liblightdm-qt/power.cpp6
-rw-r--r--liblightdm-qt/sessionsmodel.cpp6
-rw-r--r--liblightdm-qt/usersmodel.cpp6
7 files changed, 80 insertions, 21 deletions
diff --git a/liblightdm-qt/Makefile.am b/liblightdm-qt/Makefile.am
index 865637f2..d16cf966 100644
--- a/liblightdm-qt/Makefile.am
+++ b/liblightdm-qt/Makefile.am
@@ -1,24 +1,33 @@
-lib_LTLIBRARIES = liblightdm-qt-2.la
+%_moc4.cpp: QLightDM/%.h
+ $(MOC4) $< -o $@
-%_moc.cpp: QLightDM/%.h
- $(MOC) $< -o $@
+%_moc5.cpp: QLightDM/%.h
+ $(MOC5) $< -o $@
-power.cpp: power_moc.cpp
-greeter.cpp: greeter_moc.cpp
-sessionsmodel.cpp: sessionsmodel_moc.cpp
-usersmodel.cpp: usersmodel_moc.cpp
-
-liblightdm_qt_2_la_LIBADD = \
- $(LIBLIGHTDM_QT_LIBS) \
+common_libadd = \
-L$(top_builddir)/liblightdm-gobject \
-llightdm-gobject-1
+liblightdm_qt_2_la_LIBADD = \
+ $(LIBLIGHTDM_QT4_LIBS) \
+ $(common_libadd)
+liblightdm_qt5_2_la_LIBADD = \
+ $(LIBLIGHTDM_QT5_LIBS) \
+ $(common_libadd)
-liblightdm_qt_2_la_CXXFLAGS = $(LIBLIGHTDM_QT_CFLAGS) \
+common_cflags = \
-I$(top_srcdir)/liblightdm-gobject \
$(LIBLIGHTDM_GOBJECT_CFLAGS) \
-DXSESSIONS_DIR=\"$(datadir)/xsessions\"
+liblightdm_qt_2_la_CXXFLAGS = \
+ $(LIBLIGHTDM_QT4_CFLAGS) \
+ $(common_cflags)
+liblightdm_qt5_2_la_CXXFLAGS = \
+ -fPIC \
+ -DQT_DISABLE_DEPRECATED_BEFORE="QT_VERSION_CHECK(4, 0, 0)" \
+ $(LIBLIGHTDM_QT5_CFLAGS) \
+ $(common_cflags)
-liblightdm_qt_2include_HEADERS = \
+common_headers = \
QLightDM/Greeter \
QLightDM/Power \
QLightDM/SessionsModel \
@@ -29,20 +38,43 @@ liblightdm_qt_2include_HEADERS = \
QLightDM/usersmodel.h
liblightdm_qt_2includedir=$(includedir)/lightdm-qt-2/QLightDM
+liblightdm_qt5_2includedir=$(includedir)/lightdm-qt5-2/QLightDM
-liblightdm_qt_2_la_SOURCES = \
+common_sources = \
greeter.cpp \
power.cpp \
sessionsmodel.cpp \
- usersmodel.cpp \
+ usersmodel.cpp
+liblightdm_qt_2_la_SOURCES = \
+ $(common_sources) \
$(liblightdm_qt_2include_HEADERS)
+liblightdm_qt5_2_la_SOURCES = \
+ $(common_sources) \
+ $(liblightdm_qt5_2include_HEADERS)
pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = liblightdm-qt-2.pc
CLEANFILES = \
- *_moc.cpp
+ *_moc*.cpp
DISTCLEANFILES = \
Makefile.in \
$(pkgconfig_DATA)
+
+lib_LTLIBRARIES =
+BUILT_SOURCES =
+pkgconfig_DATA =
+
+if COMPILE_LIBLIGHTDM_QT4
+lib_LTLIBRARIES += liblightdm-qt-2.la
+liblightdm_qt_2include_HEADERS = $(common_headers)
+BUILT_SOURCES += $(common_sources:.cpp=_moc4.cpp)
+pkgconfig_DATA += liblightdm-qt-2.pc
+endif
+
+if COMPILE_LIBLIGHTDM_QT5
+lib_LTLIBRARIES += liblightdm-qt5-2.la
+liblightdm_qt5_2include_HEADERS = $(common_headers)
+BUILT_SOURCES += $(common_sources:.cpp=_moc5.cpp)
+pkgconfig_DATA += liblightdm-qt5-2.pc
+endif
diff --git a/liblightdm-qt/greeter.cpp b/liblightdm-qt/greeter.cpp
index ff7841e0..8fb287ff 100644
--- a/liblightdm-qt/greeter.cpp
+++ b/liblightdm-qt/greeter.cpp
@@ -252,4 +252,8 @@ QString Greeter::hostname() const
return QString::fromUtf8(lightdm_get_hostname());
}
-#include "greeter_moc.cpp"
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#include "greeter_moc5.cpp"
+#else
+#include "greeter_moc4.cpp"
+#endif
diff --git a/liblightdm-qt/liblightdm-qt-2.pc.in b/liblightdm-qt/liblightdm-qt-2.pc.in
index 2991bb2b..1217afd9 100644
--- a/liblightdm-qt/liblightdm-qt-2.pc.in
+++ b/liblightdm-qt/liblightdm-qt-2.pc.in
@@ -4,7 +4,7 @@ libdir=@libdir@
includedir=@includedir@
Name: liblightdm-qt
-Description: LightDM client library
+Description: LightDM Qt4 client library
Version: @VERSION@
Requires: QtCore QtGui
Libs: -L${libdir} -llightdm-qt-2
diff --git a/liblightdm-qt/liblightdm-qt5-2.pc.in b/liblightdm-qt/liblightdm-qt5-2.pc.in
new file mode 100644
index 00000000..bebeb5f8
--- /dev/null
+++ b/liblightdm-qt/liblightdm-qt5-2.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: liblightdm-qt5
+Description: LightDM Qt5 client library
+Version: @VERSION@
+Requires: Qt5Core Qt5Gui
+Libs: -L${libdir} -llightdm-qt5-2
+Cflags: -I${includedir}/lightdm-qt5-2
diff --git a/liblightdm-qt/power.cpp b/liblightdm-qt/power.cpp
index e6a449b7..3df5cbd5 100644
--- a/liblightdm-qt/power.cpp
+++ b/liblightdm-qt/power.cpp
@@ -110,4 +110,8 @@ void PowerInterface::restart()
d->consoleKitInterface->call("Restart");
}
-#include "power_moc.cpp"
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#include "power_moc5.cpp"
+#else
+#include "power_moc4.cpp"
+#endif
diff --git a/liblightdm-qt/sessionsmodel.cpp b/liblightdm-qt/sessionsmodel.cpp
index 1fed7f43..9ad335f9 100644
--- a/liblightdm-qt/sessionsmodel.cpp
+++ b/liblightdm-qt/sessionsmodel.cpp
@@ -146,4 +146,8 @@ QVariant SessionsModel::data(const QModelIndex &index, int role) const
return QVariant();
}
-#include "sessionsmodel_moc.cpp"
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#include "sessionsmodel_moc5.cpp"
+#else
+#include "sessionsmodel_moc4.cpp"
+#endif
diff --git a/liblightdm-qt/usersmodel.cpp b/liblightdm-qt/usersmodel.cpp
index 6dbcebab..ae9c768a 100644
--- a/liblightdm-qt/usersmodel.cpp
+++ b/liblightdm-qt/usersmodel.cpp
@@ -241,4 +241,8 @@ QVariant UsersModel::data(const QModelIndex &index, int role) const
}
-#include "usersmodel_moc.cpp"
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#include "usersmodel_moc5.cpp"
+#else
+#include "usersmodel_moc4.cpp"
+#endif