Build X11 session management only if dependencies are found

This fixes the build breakage caused by Change I50b33d05 when attempting
to compile on Linux with session management enabled but libSM and/or
libICE not present.

Change-Id: I127f32e7041deb2ff968eae8458fee7d4e95d7a5
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
Reviewed-by: aavit <eirik.aavitsland@digia.com>
This commit is contained in:
Teo Mrnjavac 2013-09-18 12:53:07 +02:00 committed by The Qt Project
parent de1f9bdc15
commit 132190c3a2
3 changed files with 3 additions and 2 deletions

View File

@ -443,7 +443,7 @@ QByteArray QXcbIntegration::wmClass() const
return m_wmClass; return m_wmClass;
} }
#ifndef QT_NO_SESSIONMANAGER #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM)
QPlatformSessionManager *QXcbIntegration::createPlatformSessionManager(const QString &id, const QString &key) const QPlatformSessionManager *QXcbIntegration::createPlatformSessionManager(const QString &id, const QString &key) const
{ {
return new QXcbSessionManager(id, key); return new QXcbSessionManager(id, key);

View File

@ -101,7 +101,7 @@ public:
QByteArray wmClass() const; QByteArray wmClass() const;
#ifndef QT_NO_SESSIONMANAGER #if !defined(QT_NO_SESSIONMANAGER) && defined(XCB_USE_SM)
QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE; QPlatformSessionManager *createPlatformSessionManager(const QString &id, const QString &key) const Q_DECL_OVERRIDE;
#endif #endif

View File

@ -74,6 +74,7 @@ contains(QT_CONFIG, xcb-render) {
# build with session management support # build with session management support
contains(QT_CONFIG, xcb-sm) { contains(QT_CONFIG, xcb-sm) {
DEFINES += XCB_USE_SM
LIBS += -lSM -lICE LIBS += -lSM -lICE
SOURCES += qxcbsessionmanager.cpp SOURCES += qxcbsessionmanager.cpp
HEADERS += qxcbsessionmanager.h HEADERS += qxcbsessionmanager.h