This commit is contained in:
Aleix Pol 2021-04-01 02:45:31 +02:00
parent ea3e4b3139
commit 41704f8d15
6 changed files with 16 additions and 11 deletions

View file

@ -45,6 +45,12 @@ include(ECMQtDeclareLoggingCategory)
add_subdirectory(src) add_subdirectory(src)
add_subdirectory(tests) 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 ecm_qt_declare_logging_category(ksld_SRCS
HEADER HEADER
layershellqt_logging.h layershellqt_logging.h

View file

@ -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 ${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) 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}) add_library(layer-shell SHARED qwaylandlayershellintegrationplugin.cpp)
target_link_libraries(layer-shell Qt5::WaylandClient Wayland::Client Qt5::XkbCommonSupportPrivate Qt::WaylandClientPrivate) target_link_libraries(layer-shell LayerShellQtInterface Qt5::WaylandClient Qt::WaylandClientPrivate Qt5::XkbCommonSupportPrivate)
target_include_directories(layer-shell PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>/LayerShellQt") target_include_directories(layer-shell PRIVATE "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>/LayerShellQt")
add_library(LayerShellQtInterface SHARED interfaces/window.cpp interfaces/shell.cpp) add_library(LayerShellQtInterface SHARED qwaylandlayersurface.cpp interfaces/window.cpp interfaces/shell.cpp qwaylandlayershellintegration.cpp qwaylandlayershell.cpp ${LAYER_SHELL_SOURCES})
target_link_libraries(LayerShellQtInterface PRIVATE layer-shell PUBLIC Qt5::Gui) target_link_libraries(LayerShellQtInterface PRIVATE Qt5::Gui Qt::WaylandClientPrivate Qt5::XkbCommonSupportPrivate Wayland::Client)
target_include_directories(LayerShellQtInterface PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>/LayerShellQt" target_include_directories(LayerShellQtInterface PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>/LayerShellQt"
INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/LayerShellQt>" INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/LayerShellQt>"
) )
@ -21,3 +21,5 @@ generate_export_header(LayerShellQtInterface
install(TARGETS layer-shell install(TARGETS layer-shell
LIBRARY DESTINATION ${QT_PLUGIN_INSTALL_DIR}/wayland-shell-integration) LIBRARY DESTINATION ${QT_PLUGIN_INSTALL_DIR}/wayland-shell-integration)
install(TARGETS LayerShellQtInterface EXPORT LayerShellQtTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})

View file

@ -17,7 +17,7 @@
namespace LayerShellQt { namespace LayerShellQt {
class QWaylandLayerShell : public QtWayland::zwlr_layer_shell_v1 class LAYERSHELLQT_EXPORT QWaylandLayerShell : public QtWayland::zwlr_layer_shell_v1
{ {
public: public:
QWaylandLayerShell(struct QtWayland::zwlr_layer_shell_v1 *shell); QWaylandLayerShell(struct QtWayland::zwlr_layer_shell_v1 *shell);

View file

@ -12,8 +12,6 @@
#include <QtWaylandClient/private/qwaylandwindow_p.h> #include <QtWaylandClient/private/qwaylandwindow_p.h>
#include <QtWaylandClient/private/qwaylanddisplay_p.h> #include <QtWaylandClient/private/qwaylanddisplay_p.h>
QT_BEGIN_NAMESPACE
namespace LayerShellQt { namespace LayerShellQt {
QWaylandLayerShellIntegration::QWaylandLayerShellIntegration() : QWaylandLayerShellIntegration::QWaylandLayerShellIntegration() :
@ -48,6 +46,4 @@ void QWaylandLayerShellIntegration::registryLayer(void *data,
} }
QT_END_NAMESPACE
//#include "qwaylandlayershellintegration.moc" //#include "qwaylandlayershellintegration.moc"

View file

@ -11,12 +11,13 @@
#include <wayland-client.h> #include <wayland-client.h>
#include <QtWaylandClient/private/qwaylandshellintegration_p.h> #include <QtWaylandClient/private/qwaylandshellintegration_p.h>
#include "layershellqt_export.h"
namespace LayerShellQt { namespace LayerShellQt {
class QWaylandLayerShell; class QWaylandLayerShell;
class QWaylandLayerShellIntegration : public QtWaylandClient::QWaylandShellIntegration class LAYERSHELLQT_EXPORT QWaylandLayerShellIntegration : public QtWaylandClient::QWaylandShellIntegration
{ {
public: public:
QWaylandLayerShellIntegration(); QWaylandLayerShellIntegration();

View file

@ -1,2 +1,2 @@
add_executable(layershellqt-test main.cpp) 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)