From 3dc00de81214bb60316a046eabefb3ba1b9b6187 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 5 Jan 2021 21:23:37 +0200 Subject: [PATCH] platformsupport: Set PUBLIC include directories This makes using platform support libs easier. --- autotests/integration/CMakeLists.txt | 2 +- platformsupport/scenes/opengl/CMakeLists.txt | 1 + platformsupport/scenes/qpainter/CMakeLists.txt | 1 + platformsupport/scenes/xrender/CMakeLists.txt | 1 + plugins/platforms/drm/CMakeLists.txt | 2 -- plugins/platforms/drm/gbm_dmabuf.cpp | 2 +- plugins/platforms/drm/scene_qpainter_drm_backend.h | 3 ++- plugins/platforms/fbdev/scene_qpainter_fb_backend.h | 2 +- plugins/platforms/virtual/CMakeLists.txt | 2 -- plugins/platforms/virtual/scene_qpainter_virtual_backend.h | 2 +- plugins/platforms/wayland/CMakeLists.txt | 1 - plugins/platforms/wayland/scene_qpainter_wayland_backend.h | 2 +- plugins/platforms/x11/common/CMakeLists.txt | 3 +-- plugins/platforms/x11/standalone/CMakeLists.txt | 3 --- plugins/platforms/x11/windowed/CMakeLists.txt | 3 --- plugins/platforms/x11/windowed/scene_qpainter_x11_backend.h | 2 +- plugins/scenes/opengl/scene_opengl.cpp | 2 +- plugins/scenes/opengl/scene_opengl.h | 3 ++- plugins/scenes/qpainter/scene_qpainter.h | 3 ++- plugins/scenes/xrender/CMakeLists.txt | 2 -- 20 files changed, 17 insertions(+), 25 deletions(-) diff --git a/autotests/integration/CMakeLists.txt b/autotests/integration/CMakeLists.txt index a1d1bbec05..53753c692d 100644 --- a/autotests/integration/CMakeLists.txt +++ b/autotests/integration/CMakeLists.txt @@ -116,7 +116,7 @@ if (XCB_ICCCM_FOUND) integrationTest(NAME testQuickTiling SRCS quick_tiling_test.cpp LIBS XCB::ICCCM) integrationTest(NAME testGlobalShortcuts SRCS globalshortcuts_test.cpp LIBS XCB::ICCCM) integrationTest(NAME testSceneQPainter SRCS scene_qpainter_test.cpp LIBS XCB::ICCCM) - integrationTest(NAME testSceneQPainterShadow SRCS scene_qpainter_shadow_test.cpp LIBS XCB::ICCCM) + integrationTest(NAME testSceneQPainterShadow SRCS scene_qpainter_shadow_test.cpp LIBS SceneQPainterBackend XCB::ICCCM) integrationTest(NAME testStackingOrder SRCS stacking_order_test.cpp LIBS XCB::ICCCM) integrationTest(NAME testDbusInterface SRCS dbus_interface_test.cpp LIBS XCB::ICCCM) integrationTest(NAME testXwaylandServerCrash SRCS xwaylandserver_crash_test.cpp LIBS XCB::ICCCM) diff --git a/platformsupport/scenes/opengl/CMakeLists.txt b/platformsupport/scenes/opengl/CMakeLists.txt index f2fcea7c8b..a46b5cb01e 100644 --- a/platformsupport/scenes/opengl/CMakeLists.txt +++ b/platformsupport/scenes/opengl/CMakeLists.txt @@ -21,3 +21,4 @@ ecm_qt_declare_logging_category(SCENE_OPENGL_BACKEND_SRCS add_library(SceneOpenGLBackend STATIC ${SCENE_OPENGL_BACKEND_SRCS}) target_link_libraries(SceneOpenGLBackend Qt5::Core Qt5::Widgets KF5::CoreAddons KF5::ConfigCore KF5::WindowSystem Plasma::KWaylandServer) +target_include_directories(SceneOpenGLBackend PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/platformsupport/scenes/qpainter/CMakeLists.txt b/platformsupport/scenes/qpainter/CMakeLists.txt index 1c5e5d9e34..d54c4be487 100644 --- a/platformsupport/scenes/qpainter/CMakeLists.txt +++ b/platformsupport/scenes/qpainter/CMakeLists.txt @@ -14,3 +14,4 @@ ecm_qt_declare_logging_category(SCENE_QPAINTER_BACKEND_SRCS add_library(SceneQPainterBackend STATIC ${SCENE_QPAINTER_BACKEND_SRCS}) target_link_libraries(SceneQPainterBackend Qt5::Core) +target_include_directories(SceneQPainterBackend PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/platformsupport/scenes/xrender/CMakeLists.txt b/platformsupport/scenes/xrender/CMakeLists.txt index bbe7d7381a..c759b28d22 100644 --- a/platformsupport/scenes/xrender/CMakeLists.txt +++ b/platformsupport/scenes/xrender/CMakeLists.txt @@ -9,3 +9,4 @@ ecm_qt_declare_logging_category(xrenderbackend_SOURCES add_library(SceneXRenderBackend STATIC ${xrenderbackend_SOURCES}) target_link_libraries(SceneXRenderBackend kwin Qt5::Core Qt5::Gui) +target_include_directories(SceneXRenderBackend PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/plugins/platforms/drm/CMakeLists.txt b/plugins/platforms/drm/CMakeLists.txt index 589cd203a0..de687aa030 100644 --- a/plugins/platforms/drm/CMakeLists.txt +++ b/plugins/platforms/drm/CMakeLists.txt @@ -30,8 +30,6 @@ if (HAVE_EGL_STREAMS) ) endif() -include_directories(${CMAKE_SOURCE_DIR}/platformsupport/scenes/opengl) - add_library(KWinWaylandDrmBackend MODULE ${DRM_SOURCES}) set_target_properties(KWinWaylandDrmBackend PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/org.kde.kwin.waylandbackends/") target_link_libraries(KWinWaylandDrmBackend kwin Libdrm::Libdrm SceneQPainterBackend SceneOpenGLBackend) diff --git a/plugins/platforms/drm/gbm_dmabuf.cpp b/plugins/platforms/drm/gbm_dmabuf.cpp index 866ac7a13a..d6687458a7 100644 --- a/plugins/platforms/drm/gbm_dmabuf.cpp +++ b/plugins/platforms/drm/gbm_dmabuf.cpp @@ -5,8 +5,8 @@ */ #include "gbm_dmabuf.h" +#include "drm_fourcc.h" #include "kwineglimagetexture.h" -#include "platformsupport/scenes/opengl/drm_fourcc.h" #include "main.h" #include "platform.h" #include diff --git a/plugins/platforms/drm/scene_qpainter_drm_backend.h b/plugins/platforms/drm/scene_qpainter_drm_backend.h index d1afc145e2..aa3ee45067 100644 --- a/plugins/platforms/drm/scene_qpainter_drm_backend.h +++ b/plugins/platforms/drm/scene_qpainter_drm_backend.h @@ -8,7 +8,8 @@ */ #ifndef KWIN_SCENE_QPAINTER_DRM_BACKEND_H #define KWIN_SCENE_QPAINTER_DRM_BACKEND_H -#include +#include "qpainterbackend.h" + #include #include diff --git a/plugins/platforms/fbdev/scene_qpainter_fb_backend.h b/plugins/platforms/fbdev/scene_qpainter_fb_backend.h index 03fe2764c7..d72a826712 100644 --- a/plugins/platforms/fbdev/scene_qpainter_fb_backend.h +++ b/plugins/platforms/fbdev/scene_qpainter_fb_backend.h @@ -8,7 +8,7 @@ */ #ifndef KWIN_SCENE_QPAINTER_FB_BACKEND_H #define KWIN_SCENE_QPAINTER_FB_BACKEND_H -#include +#include "qpainterbackend.h" #include #include diff --git a/plugins/platforms/virtual/CMakeLists.txt b/plugins/platforms/virtual/CMakeLists.txt index 4feb17844c..cfe96f71d0 100644 --- a/plugins/platforms/virtual/CMakeLists.txt +++ b/plugins/platforms/virtual/CMakeLists.txt @@ -5,8 +5,6 @@ set(VIRTUAL_SOURCES virtual_output.cpp ) -include_directories(${CMAKE_SOURCE_DIR}/platformsupport/scenes/opengl) - include(ECMQtDeclareLoggingCategory) ecm_qt_declare_logging_category(VIRTUAL_SOURCES HEADER logging.h IDENTIFIER KWIN_VIRTUAL CATEGORY_NAME kwin_platform_virtual DEFAULT_SEVERITY Critical) diff --git a/plugins/platforms/virtual/scene_qpainter_virtual_backend.h b/plugins/platforms/virtual/scene_qpainter_virtual_backend.h index dcb7372d0f..759b28eb53 100644 --- a/plugins/platforms/virtual/scene_qpainter_virtual_backend.h +++ b/plugins/platforms/virtual/scene_qpainter_virtual_backend.h @@ -9,7 +9,7 @@ #ifndef KWIN_SCENE_QPAINTER_VIRTUAL_BACKEND_H #define KWIN_SCENE_QPAINTER_VIRTUAL_BACKEND_H -#include +#include "qpainterbackend.h" #include #include diff --git a/plugins/platforms/wayland/CMakeLists.txt b/plugins/platforms/wayland/CMakeLists.txt index d11c2441ac..2412686d20 100644 --- a/plugins/platforms/wayland/CMakeLists.txt +++ b/plugins/platforms/wayland/CMakeLists.txt @@ -12,7 +12,6 @@ if (HAVE_WAYLAND_EGL) endif() endif() -include_directories(${CMAKE_SOURCE_DIR}/platformsupport/scenes/opengl) add_library(KWinWaylandWaylandBackend MODULE ${WAYLAND_BACKEND_SOURCES}) set_target_properties(KWinWaylandWaylandBackend PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/org.kde.kwin.waylandbackends/") target_link_libraries(KWinWaylandWaylandBackend kwin KF5::WaylandClient SceneQPainterBackend) diff --git a/plugins/platforms/wayland/scene_qpainter_wayland_backend.h b/plugins/platforms/wayland/scene_qpainter_wayland_backend.h index 45bfad474f..8b51abb30b 100644 --- a/plugins/platforms/wayland/scene_qpainter_wayland_backend.h +++ b/plugins/platforms/wayland/scene_qpainter_wayland_backend.h @@ -10,7 +10,7 @@ #ifndef KWIN_SCENE_QPAINTER_WAYLAND_BACKEND_H #define KWIN_SCENE_QPAINTER_WAYLAND_BACKEND_H -#include +#include "qpainterbackend.h" #include #include diff --git a/plugins/platforms/x11/common/CMakeLists.txt b/plugins/platforms/x11/common/CMakeLists.txt index d52ff2550f..890f8e09b2 100644 --- a/plugins/platforms/x11/common/CMakeLists.txt +++ b/plugins/platforms/x11/common/CMakeLists.txt @@ -4,6 +4,5 @@ endif() if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-int-to-void-pointer-cast") endif() -include_directories(${CMAKE_SOURCE_DIR}/platformsupport/scenes/opengl) add_library(eglx11common STATIC eglonxbackend.cpp) -target_link_libraries(eglx11common kwin) +target_link_libraries(eglx11common kwin SceneOpenGLBackend) diff --git a/plugins/platforms/x11/standalone/CMakeLists.txt b/plugins/platforms/x11/standalone/CMakeLists.txt index bc69868890..5c31fe9424 100644 --- a/plugins/platforms/x11/standalone/CMakeLists.txt +++ b/plugins/platforms/x11/standalone/CMakeLists.txt @@ -26,9 +26,6 @@ if (HAVE_EPOXY_GLX) set(X11PLATFORM_SOURCES ${X11PLATFORM_SOURCES} glxbackend.cpp glx_context_attribute_builder.cpp) endif() -include_directories(${CMAKE_SOURCE_DIR}/platformsupport/scenes/opengl) -include_directories(${CMAKE_SOURCE_DIR}/platformsupport/scenes/xrender) - add_library(KWinX11Platform MODULE ${X11PLATFORM_SOURCES}) set_target_properties(KWinX11Platform PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/org.kde.kwin.platforms/") target_link_libraries(KWinX11Platform eglx11common kwin kwinxrenderutils SceneOpenGLBackend VsyncSupport Qt5::X11Extras XCB::CURSOR KF5::Crash ) diff --git a/plugins/platforms/x11/windowed/CMakeLists.txt b/plugins/platforms/x11/windowed/CMakeLists.txt index b4908d686d..a1e687db76 100644 --- a/plugins/platforms/x11/windowed/CMakeLists.txt +++ b/plugins/platforms/x11/windowed/CMakeLists.txt @@ -6,9 +6,6 @@ set(X11BACKEND_SOURCES x11windowed_output.cpp ) -include_directories(${CMAKE_SOURCE_DIR}/platformsupport/scenes/opengl) -include_directories(${CMAKE_SOURCE_DIR}/platformsupport/vsyncconvenience) - add_library(KWinWaylandX11Backend MODULE ${X11BACKEND_SOURCES}) set_target_properties(KWinWaylandX11Backend PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/org.kde.kwin.waylandbackends/") target_link_libraries(KWinWaylandX11Backend eglx11common kwin kwinxrenderutils X11::XCB SceneQPainterBackend SceneOpenGLBackend VsyncSupport) diff --git a/plugins/platforms/x11/windowed/scene_qpainter_x11_backend.h b/plugins/platforms/x11/windowed/scene_qpainter_x11_backend.h index d6cb820663..ae96312d8b 100644 --- a/plugins/platforms/x11/windowed/scene_qpainter_x11_backend.h +++ b/plugins/platforms/x11/windowed/scene_qpainter_x11_backend.h @@ -9,7 +9,7 @@ #ifndef KWIN_SCENE_QPAINTER_X11_BACKEND_H #define KWIN_SCENE_QPAINTER_X11_BACKEND_H -#include +#include "qpainterbackend.h" #include #include diff --git a/plugins/scenes/opengl/scene_opengl.cpp b/plugins/scenes/opengl/scene_opengl.cpp index a9526e9838..20c5f254eb 100644 --- a/plugins/scenes/opengl/scene_opengl.cpp +++ b/plugins/scenes/opengl/scene_opengl.cpp @@ -17,10 +17,10 @@ SPDX-License-Identifier: GPL-2.0-or-later */ #include "scene_opengl.h" +#include "texture.h" #include "platform.h" #include "wayland_server.h" -#include "platformsupport/scenes/opengl/texture.h" #include #include diff --git a/plugins/scenes/opengl/scene_opengl.h b/plugins/scenes/opengl/scene_opengl.h index b879ea0a42..890790e6e6 100644 --- a/plugins/scenes/opengl/scene_opengl.h +++ b/plugins/scenes/opengl/scene_opengl.h @@ -11,13 +11,14 @@ #ifndef KWIN_SCENE_OPENGL_H #define KWIN_SCENE_OPENGL_H +#include "openglbackend.h" + #include "scene.h" #include "shadow.h" #include "kwinglutils.h" #include "decorations/decorationrenderer.h" -#include "platformsupport/scenes/opengl/openglbackend.h" namespace KWin { diff --git a/plugins/scenes/qpainter/scene_qpainter.h b/plugins/scenes/qpainter/scene_qpainter.h index 5bf71b8bb3..5fb06cb42a 100644 --- a/plugins/scenes/qpainter/scene_qpainter.h +++ b/plugins/scenes/qpainter/scene_qpainter.h @@ -9,8 +9,9 @@ #ifndef KWIN_SCENE_QPAINTER_H #define KWIN_SCENE_QPAINTER_H +#include "qpainterbackend.h" + #include "scene.h" -#include #include "shadow.h" #include "decorations/decorationrenderer.h" diff --git a/plugins/scenes/xrender/CMakeLists.txt b/plugins/scenes/xrender/CMakeLists.txt index e5be934405..6cf94ce5d1 100644 --- a/plugins/scenes/xrender/CMakeLists.txt +++ b/plugins/scenes/xrender/CMakeLists.txt @@ -12,8 +12,6 @@ ecm_qt_declare_logging_category( Critical ) -include_directories(${CMAKE_SOURCE_DIR}/platformsupport/scenes/xrender) - add_library(KWinSceneXRender MODULE ${SCENE_XRENDER_SRCS}) set_target_properties(KWinSceneXRender PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/org.kde.kwin.scenes/") target_link_libraries(KWinSceneXRender kwin kwinxrenderutils SceneXRenderBackend)