From 41704f8d152021d3e9d91219dfd9f3c9d904d493 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Thu, 1 Apr 2021 02:45:31 +0200 Subject: [PATCH] Fixes --- CMakeLists.txt | 6 ++++++ src/CMakeLists.txt | 10 ++++++---- src/qwaylandlayershell_p.h | 2 +- src/qwaylandlayershellintegration.cpp | 4 ---- src/qwaylandlayershellintegration_p.h | 3 ++- tests/CMakeLists.txt | 2 +- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11ff049..bc2e804 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,12 @@ include(ECMQtDeclareLoggingCategory) add_subdirectory(src) add_subdirectory(tests) +set(CMAKECONFIG_INSTALL_DIR ${KDE_INSTALL_LIBDIR}/cmake/LayerShellQt) +install(EXPORT LayerShellQtTargets + NAMESPACE LayerShellQt:: + DESTINATION ${CMAKECONFIG_INSTALL_DIR} + FILE LayerShellQtTargets.cmake ) + ecm_qt_declare_logging_category(ksld_SRCS HEADER layershellqt_logging.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 021e2ee..969c0e9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,12 +3,12 @@ remove_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS) ecm_add_qtwayland_client_protocol(LAYER_SHELL_SOURCES PROTOCOL ${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml BASENAME xdg-shell) ecm_add_qtwayland_client_protocol(LAYER_SHELL_SOURCES PROTOCOL wlr-layer-shell-unstable-v1.xml BASENAME wlr-layer-shell-unstable-v1) -add_library(layer-shell SHARED qwaylandlayersurface.cpp qwaylandlayershellintegration.cpp qwaylandlayershell.cpp qwaylandlayershellintegrationplugin.cpp ${LAYER_SHELL_SOURCES}) -target_link_libraries(layer-shell Qt5::WaylandClient Wayland::Client Qt5::XkbCommonSupportPrivate Qt::WaylandClientPrivate) +add_library(layer-shell SHARED qwaylandlayershellintegrationplugin.cpp) +target_link_libraries(layer-shell LayerShellQtInterface Qt5::WaylandClient Qt::WaylandClientPrivate Qt5::XkbCommonSupportPrivate) target_include_directories(layer-shell PRIVATE "$/LayerShellQt") -add_library(LayerShellQtInterface SHARED interfaces/window.cpp interfaces/shell.cpp) -target_link_libraries(LayerShellQtInterface PRIVATE layer-shell PUBLIC Qt5::Gui) +add_library(LayerShellQtInterface SHARED qwaylandlayersurface.cpp interfaces/window.cpp interfaces/shell.cpp qwaylandlayershellintegration.cpp qwaylandlayershell.cpp ${LAYER_SHELL_SOURCES}) +target_link_libraries(LayerShellQtInterface PRIVATE Qt5::Gui Qt::WaylandClientPrivate Qt5::XkbCommonSupportPrivate Wayland::Client) target_include_directories(LayerShellQtInterface PUBLIC "$/LayerShellQt" INTERFACE "$" ) @@ -21,3 +21,5 @@ generate_export_header(LayerShellQtInterface install(TARGETS layer-shell LIBRARY DESTINATION ${QT_PLUGIN_INSTALL_DIR}/wayland-shell-integration) + +install(TARGETS LayerShellQtInterface EXPORT LayerShellQtTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/src/qwaylandlayershell_p.h b/src/qwaylandlayershell_p.h index ddef3a8..de716b5 100644 --- a/src/qwaylandlayershell_p.h +++ b/src/qwaylandlayershell_p.h @@ -17,7 +17,7 @@ namespace LayerShellQt { -class QWaylandLayerShell : public QtWayland::zwlr_layer_shell_v1 +class LAYERSHELLQT_EXPORT QWaylandLayerShell : public QtWayland::zwlr_layer_shell_v1 { public: QWaylandLayerShell(struct QtWayland::zwlr_layer_shell_v1 *shell); diff --git a/src/qwaylandlayershellintegration.cpp b/src/qwaylandlayershellintegration.cpp index 83a2dcb..eb14d3d 100644 --- a/src/qwaylandlayershellintegration.cpp +++ b/src/qwaylandlayershellintegration.cpp @@ -12,8 +12,6 @@ #include #include -QT_BEGIN_NAMESPACE - namespace LayerShellQt { QWaylandLayerShellIntegration::QWaylandLayerShellIntegration() : @@ -48,6 +46,4 @@ void QWaylandLayerShellIntegration::registryLayer(void *data, } -QT_END_NAMESPACE - //#include "qwaylandlayershellintegration.moc" diff --git a/src/qwaylandlayershellintegration_p.h b/src/qwaylandlayershellintegration_p.h index 69daf13..04743cc 100644 --- a/src/qwaylandlayershellintegration_p.h +++ b/src/qwaylandlayershellintegration_p.h @@ -11,12 +11,13 @@ #include #include +#include "layershellqt_export.h" namespace LayerShellQt { class QWaylandLayerShell; -class QWaylandLayerShellIntegration : public QtWaylandClient::QWaylandShellIntegration +class LAYERSHELLQT_EXPORT QWaylandLayerShellIntegration : public QtWaylandClient::QWaylandShellIntegration { public: QWaylandLayerShellIntegration(); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 39b260b..81f63eb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,2 +1,2 @@ add_executable(layershellqt-test main.cpp) -target_link_libraries(layershellqt-test PRIVATE LayerShellQtInterface Qt5::Qml) +target_link_libraries(layershellqt-test PRIVATE LayerShellQtInterface Qt5::Qml Qt5::Gui)