1
0
Fork 0

Move kwayland-qt6 patch to kwayland build rule folder

This commit is contained in:
Ilya Fedin 2021-12-31 00:16:18 +04:00 committed by John Preston
parent f4833c67b8
commit ed7cf04191
4 changed files with 100 additions and 5 deletions

3
.gitmodules vendored
View file

@ -1,3 +0,0 @@
[submodule "patches"]
path = patches
url = https://github.com/desktop-app/patches.git

View file

@ -20,7 +20,7 @@ add_library(external_kwayland_bundled STATIC IMPORTED)
set(kwayland_patch_command)
if (DESKTOP_APP_QT6)
set(kwayland_patch_command PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/../../patches/kwayland-qt6.patch)
set(kwayland_patch_command PATCH_COMMAND patch -p1 < ${CMAKE_CURRENT_SOURCE_DIR}/kwayland-qt6.patch)
endif()
include(ExternalProject)

99
external/kwayland/kwayland-qt6.patch vendored Normal file
View file

@ -0,0 +1,99 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b478cde..5f19170 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,10 +31,8 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX KWAYLAND
# Dependencies
set(REQUIRED_QT_VERSION 5.15.2)
-find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Private)
-find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Concurrent WaylandClient)
-
-find_package(QtWaylandScanner REQUIRED)
+find_package(Qt6Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS Private)
+find_package(Qt6 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Concurrent WaylandClient)
find_package(Wayland 1.15 COMPONENTS Client Server)
set_package_properties(Wayland PROPERTIES
@@ -69,14 +67,8 @@ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f02)
# Subdirectories
ecm_install_po_files_as_qm(po)
-find_package(QtWaylandScanner REQUIRED)
add_subdirectory(src)
-if (BUILD_TESTING)
- add_subdirectory(autotests)
- add_subdirectory(tests)
-endif()
-
# create a Config.cmake and a ConfigVersion.cmake file and install them
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Wayland")
diff --git a/KF5WaylandConfig.cmake.in b/KF5WaylandConfig.cmake.in
index ef20432..1294d3e 100644
--- a/KF5WaylandConfig.cmake.in
+++ b/KF5WaylandConfig.cmake.in
@@ -1,7 +1,7 @@
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
-find_dependency(Qt5Gui @REQUIRED_QT_VERSION@)
+find_dependency(Qt6Gui @REQUIRED_QT_VERSION@)
include("${CMAKE_CURRENT_LIST_DIR}/KF5WaylandTargets.cmake")
@PACKAGE_INCLUDE_QCHTARGETS@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c8a307c..e6497c8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,6 +1,4 @@
add_subdirectory(client)
-add_subdirectory(server)
-add_subdirectory(tools)
ecm_qt_install_logging_categories(
EXPORT KWAYLAND
@@ -36,7 +34,7 @@ if(BUILD_QCH)
${KWaylandServer_APIDOX_SRCS}
MD_MAINPAGE "${CMAKE_SOURCE_DIR}/README.md"
LINK_QCHS
- Qt5Gui_QCH
+ Qt6Gui_QCH
INCLUDE_DIRS
${KWaylandClient_APIDOX_BUILD_INCLUDE_DIRS}
${KWaylandServer_APIDOX_BUILD_INCLUDE_DIRS}
diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt
index b7ec33a..efb390a 100644
--- a/src/client/CMakeLists.txt
+++ b/src/client/CMakeLists.txt
@@ -3,7 +3,7 @@ remove_definitions(-DQT_NO_CAST_FROM_ASCII)
remove_definitions(-DQT_NO_CAST_TO_ASCII)
# needed to access QPA
-include_directories(SYSTEM ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
+include_directories(SYSTEM ${Qt6Gui_PRIVATE_INCLUDE_DIRS})
set(CLIENT_LIB_SRCS
appmenu.cpp
@@ -256,10 +256,17 @@ ecm_generate_export_header(KF5WaylandClient
target_include_directories(KF5WaylandClient INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/KWayland/Client>")
+target_include_directories(KF5WaylandClient
+ PRIVATE ${Wayland_Client_INCLUDE_DIR}
+ ${Qt6Concurrent_INCLUDE_DIRS}
+)
+
+get_target_property(Qt6Concurrent_LIBRARIES Qt6::Concurrent IMPORTED_LOCATION)
+
target_link_libraries(KF5WaylandClient
- PUBLIC Qt5::Gui
- PRIVATE Wayland::Client
- Qt5::Concurrent
+ PUBLIC Qt6::Gui
+ PRIVATE ${Wayland_Client_LIBRARY}
+ ${Qt6Concurrent_LIBRARIES}
)
set_target_properties(KF5WaylandClient PROPERTIES VERSION ${KWAYLAND_VERSION}

@ -1 +0,0 @@
Subproject commit 83a901f499c638efa54eb88aa0a2645746acda27