summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2012-03-11 13:05:08 +0100
committerPaul Olav Tvete <paul.tvete@nokia.com>2012-03-12 17:11:42 +0100
commita2401ec66dfa18a8788079211fc422db4298e8b3 (patch)
tree848e60296a5603c3987fbde9088650cc539263f1
parent6fbccbdbd922323e125f33472fd55e89491b2a8c (diff)
Make the module not depend on QtBase configure
This is convenient if we want to reconfigure without reconfiguring QtBase. Change-Id: I47dabeb4a66161fd0f7cafd57d00a6ee0097d8d3 Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
-rw-r--r--config.tests/xkbcommon/main.cpp58
-rw-r--r--config.tests/xkbcommon/xkbcommon.pro17
-rw-r--r--qtwayland.pro18
-rw-r--r--src/compositor/compositor.pri33
-rw-r--r--src/plugins/platforms/wayland/wayland.pro59
-rw-r--r--sync.profile5
6 files changed, 149 insertions, 41 deletions
diff --git a/config.tests/xkbcommon/main.cpp b/config.tests/xkbcommon/main.cpp
new file mode 100644
index 000000000..9f10f3ea9
--- /dev/null
+++ b/config.tests/xkbcommon/main.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the Qt Compositor.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+** the names of its contributors may be used to endorse or promote
+** products derived from this software without specific prior written
+** permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <X11/extensions/XKBcommon.h>
+#include <X11/keysym.h>
+
+#include <QtCore/qnamespace.h>
+
+int main(int argc, char **argv)
+{
+ struct xkb_rule_names names;
+ names.rules = "evdev";
+ names.model = "pc105";
+ names.layout = "us";
+ names.variant = "";
+ names.options = "";
+
+ struct xkb_desc *xkb = xkb_compile_keymap_from_rules(&names);
+ Q_UNUSED(xkb);
+ return 0;
+}
diff --git a/config.tests/xkbcommon/xkbcommon.pro b/config.tests/xkbcommon/xkbcommon.pro
new file mode 100644
index 000000000..facc28e58
--- /dev/null
+++ b/config.tests/xkbcommon/xkbcommon.pro
@@ -0,0 +1,17 @@
+TEMPLATE = app
+TARGET = xkbcommon
+QT = core
+DEPENDPATH += .
+INCLUDEPATH += .
+
+!contains(QT_CONFIG, no-pkg-config) {
+ QMAKE_CFLAGS_XKBCOMMON=$$system(pkg-config --cflags xkbcommon 2>/dev/null)
+ QMAKE_LIBS_XKBCOMMON=$$system(pkg-config --libs xkbcommon 2>/dev/null)
+}
+
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+LIBS += $$QMAKE_LIBS_XKBCOMMON
+
+# Input
+SOURCES += main.cpp
diff --git a/qtwayland.pro b/qtwayland.pro
index 2d56e733a..c04891504 100644
--- a/qtwayland.pro
+++ b/qtwayland.pro
@@ -1,14 +1,16 @@
TEMPLATE=subdirs
+CONFIG += ordered
-module_qtcompositor_src.subdir = src
-module_qtcompositor_src.target = module-module_qtcompositor_src
+module_qtwayland_src.subdir = src
+module_qtwayland_src.target = module-qtwayland-src
-module_qtcompositor_examples.subdir = examples
-module_qtcompositor_examples.target = module_qtcompositor_examples
-module_qtcompositor_examples.depends = module_qtcompositor_src
+module_qtwayland_examples.subdir = examples
+module_qtwayland_examples.target = module-qtwayland-examples
+module_qtwayland_examples.depends = module_qtwayland_src
!contains(QT_BUILD_PARTS,examples) {
- module_qtcompositor_examples.CONFIG = no_default_target no_default_install
+ module_qtwayland_examples.CONFIG = no_default_target no_default_install
}
-SUBDIRS += module_qtcompositor_src \
- module_qtcompositor_examples \
+SUBDIRS += module_qtwayland_src \
+ module_qtwayland_examples \
+ module_qtwayland_tests
diff --git a/src/compositor/compositor.pri b/src/compositor/compositor.pri
index 7962b05ba..77467c2dd 100644
--- a/src/compositor/compositor.pri
+++ b/src/compositor/compositor.pri
@@ -7,24 +7,27 @@ INCLUDEPATH += $$PWD
DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT
DEFINES += QT_BUILD_COMPOSITOR_LIB
-!mac:use_pkgconfig {
- CONFIG += link_pkgconfig
- PKGCONFIG += wayland-server
+!contains(QT_CONFIG, no-pkg-config) {
+ #If Qt uses pkg-config then override pkgconfig from mkspec
+ QMAKE_CFLAGS_WAYLAND=$$system(pkg-config --cflags wayland-server 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_SERVER=$$system(pkg-config --libs-only-l wayland-server 2>/dev/null)
+ QMAKE_INCDIR_WAYLAND=$$system("pkg-config --cflags-only-I wayland-server 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'")
+ QMAKE_LIBDIR_WAYLAND=$$system("pkg-config --libs-only-L wayland-server 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'")
+ QMAKE_DEFINES_WAYLAND=""
+}
- #set the rpath
- !isEmpty(QMAKE_LFLAGS_RPATH) {
- WAYLAND_NEEDS_RPATH = $$system(pkg-config --libs-only-L wayland-server)
- !isEmpty(WAYLAND_NEEDS_RPATH) {
- WAYLAND_LIBDIR = $$system(pkg-config --variable=libdir wayland-server)
- !isEmpty(WAYLAND_LIBDIR):QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${WAYLAND_LIBDIR}
- }
- }
-} else {
- INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND
+QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_WAYLAND
+DEFINES += $$QMAKE_DEFINES_WAYLAND
+LIBS += $$QMAKE_LIBS_WAYLAND_SERVER
+!isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+}
+
+!isEmpty(QMAKE_LFLAGS_RPATH) {
!isEmpty(QMAKE_LIBDIR_WAYLAND) {
- LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+ QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBS_WAYLAND}
}
- LIBS += -lwayland-server -lffi
}
HEADERS += qtcompositorversion.h
diff --git a/src/plugins/platforms/wayland/wayland.pro b/src/plugins/platforms/wayland/wayland.pro
index 9d43c877d..73909bf68 100644
--- a/src/plugins/platforms/wayland/wayland.pro
+++ b/src/plugins/platforms/wayland/wayland.pro
@@ -6,21 +6,8 @@ CONFIG += qpa/genericunixfontdatabase
DESTDIR = $$QT.gui.plugins/platforms
-DEFINES += Q_PLATFORM_WAYLAND
-DEFINES += $$QMAKE_DEFINES_WAYLAND
-
-mac {
- DEFINES += QT_NO_WAYLAND_XKB
-}
-
QT += core-private gui-private platformsupport-private
-WAYLANDSOURCES += \
- $$PWD/../../../../extensions/surface-extension.xml \
- $$PWD/../../../../extensions/sub-surface-extension.xml \
- $$PWD/../../../../extensions/output-extension.xml \
- $$PWD/../../../../extensions/touch-extension.xml
-
SOURCES = main.cpp \
qwaylandintegration.cpp \
qwaylandnativeinterface.cpp \
@@ -66,18 +53,54 @@ HEADERS = qwaylandintegration.h \
qwaylandtouch.h \
$$PWD/../../../shared/qwaylandmimehelper.h
+DEFINES += Q_PLATFORM_WAYLAND
+
+contains(config_test_xkbcommon,yes) {
+ !contains(QT_CONFIG, no-pkg-config) {
+ QMAKE_CFLAGS_XKBCOMMON=$$system(pkg-config --cflags xkbcommon 2>/dev/null)
+ QMAKE_LIBS_XKBCOMMON=$$system(pkg-config --libs xkbcommon 2>/dev/null)
+ }
+
+ QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+ QMAKE_CFLAGS += $$QMAKE_CFLAGS_XKBCOMMON
+ LIBS += $$QMAKE_LIBS_XKBCOMMON
+} else {
+ DEFINES += QT_NO_WAYLAND_XKB
+}
+
+WAYLANDSOURCES += \
+ $$PWD/../../../../extensions/surface-extension.xml \
+ $$PWD/../../../../extensions/sub-surface-extension.xml \
+ $$PWD/../../../../extensions/output-extension.xml \
+ $$PWD/../../../../extensions/touch-extension.xml
+
+
OTHER_FILES += wayland.json
INCLUDEPATH += $$PWD/../../../shared
-INCLUDEPATH += $$QMAKE_INCDIR_WAYLAND
-
-LIBS += $$QMAKE_LIBS_WAYLAND
-mac {
- LIBS += -lwayland-client
+!contains(QT_CONFIG, no-pkg-config) {
+ #If Qt uses pkg-config then override pkgconfig from mkspec
+ QMAKE_CFLAGS_WAYLAND=$$system(pkg-config --cflags wayland-client 2>/dev/null)
+ QMAKE_LIBS_WAYLAND_CLIENT=$$system(pkg-config --libs-only-l wayland-client 2>/dev/null)
+ QMAKE_INCDIR_WAYLAND=$$system("pkg-config --cflags-only-I wayland-client 2>/dev/null | sed -e 's,^-I,,g' -e 's, -I, ,g'")
+ QMAKE_LIBDIR_WAYLAND=$$system("pkg-config --libs-only-L wayland-client 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'")
+ QMAKE_DEFINES_WAYLAND=""
}
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_WAYLAND
+QMAKE_CFLAGS += $$QMAKE_CFLAGS_WAYLAND
+DEFINES += $$QMAKE_DEFINES_WAYLAND
+LIBS += $$QMAKE_LIBS_WAYLAND_CLIENT
+!isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ LIBS += -L$$QMAKE_LIBDIR_WAYLAND
+}
+
+!isEmpty(QMAKE_LFLAGS_RPATH) {
+ !isEmpty(QMAKE_LIBDIR_WAYLAND) {
+ QMAKE_LFLAGS += $${QMAKE_LFLAGS_RPATH}$${QMAKE_LIBS_WAYLAND}
+ }
+}
target.path += $$[QT_INSTALL_PLUGINS]/platforms
INSTALLS += target
diff --git a/sync.profile b/sync.profile
index 27887ee82..e964999d5 100644
--- a/sync.profile
+++ b/sync.profile
@@ -22,3 +22,8 @@
%dependencies = (
"qtbase" => "refs/heads/master",
);
+
+# Compile tests
+%configtests = (
+ "xkbcommon" => {}
+);