summaryrefslogtreecommitdiff
blob: 90273b072f0ee950a9665107a1951a8931689fba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
From 69c2186c1a6c4fc0bf7f13b571b581e5f6157063 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sat, 27 Nov 2021 14:36:20 +0100
Subject: [PATCH] Add CMake option to build without X11

Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
 CMakeLists.txt        | 16 ++++++++++------
 client/CMakeLists.txt |  4 ++--
 src/CMakeLists.txt    |  6 +++---
 3 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 77f5ea645..488ee7dc4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,12 +46,16 @@ if(Qt5WebEngineWidgets_VERSION VERSION_LESS "5.14.0")
   add_definitions(-DWEBENGINEDOWNLOADITEM_USE_PATH)
 endif()
 
-find_package(X11)
-set(KONQ_HAVE_X11 ${X11_FOUND})
-
-if (X11_FOUND)
-  find_package(Qt5 REQUIRED X11Extras)
-endif(X11_FOUND)
+if (NOT WIN32)
+    option(WITH_X11 "Build with X11 integration" ON)
+    if (WITH_X11)
+        find_package(X11 REQUIRED)
+        find_package(Qt5X11Extras NO_MODULE REQUIRED)
+        set(KONQ_HAVE_X11 TRUE)
+    endif()
+else()
+    set(WITH_X11 OFF)
+endif()
 
 add_definitions(
     -DQT_USE_QSTRINGBUILDER
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index 24aedb14c..51d2b44d0 100644
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -30,9 +30,9 @@ if (WIN32)
 else (WIN32)
     kf5_add_kdeinit_executable( kfmclient NOGUI ${kfmclient_SRCS})
     target_link_libraries(kdeinit_kfmclient ${kfmclient_LIBS})
-    if(X11_FOUND)
+    if(WITH_X11)
       target_link_libraries(kdeinit_kfmclient Qt5::X11Extras)
-    endif(X11_FOUND)
+    endif()
     install(TARGETS kdeinit_kfmclient  ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
 endif (WIN32)
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2113e1c2f..07e64d90f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -33,9 +33,9 @@ target_link_libraries(konquerorprivate
    KF5::KIOGui
 )
 
-if(X11_FOUND)
+if(WITH_X11)
   target_link_libraries(konquerorprivate Qt5::X11Extras)
-endif(X11_FOUND)
+endif()
 
 
 set_target_properties(konquerorprivate PROPERTIES VERSION ${KONQUEROR_LIB_VERSION} SOVERSION "5" )
@@ -113,7 +113,7 @@ target_link_libraries(kdeinit_konqueror
    KF5::SonnetUi
 )
 
-if (X11_FOUND)
+if (WITH_X11)
   target_link_libraries(kdeinit_konqueror ${X11_LIBRARIES})
 endif ()
 
-- 
2.34.1