Skip to content

Commit 10fcc66

Browse files
committed
cmake: Add WITH_DBUS option
1 parent 5bb5a4b commit 10fcc66

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,16 @@ if(WITH_QRENCODE)
151151
set(USE_QRCODE TRUE)
152152
endif()
153153

154+
cmake_dependent_option(WITH_DBUS "Enable DBus support." ON "CMAKE_SYSTEM_NAME STREQUAL \"Linux\" AND BUILD_GUI" OFF)
154155
if(BUILD_GUI)
155156
set(qt_components Core Gui Widgets LinguistTools)
156157
if(ENABLE_WALLET)
157158
list(APPEND qt_components Network)
158159
endif()
160+
if(WITH_DBUS)
161+
list(APPEND qt_components DBus)
162+
set(USE_DBUS TRUE)
163+
endif()
159164
find_package(Qt5 5.11.3 MODULE REQUIRED
160165
COMPONENTS ${qt_components}
161166
)
@@ -498,6 +503,7 @@ message(" - using UPnP ....................... ${WITH_MINIUPNPC}")
498503
message(" ZeroMQ .............................. ${WITH_ZMQ}")
499504
message(" USDT tracing ........................ ${WITH_USDT}")
500505
message(" QR code (GUI) ....................... ${WITH_QRENCODE}")
506+
message(" DBus (GUI, Linux only) .............. ${WITH_DBUS}")
501507
message("Tests:")
502508
message(" test_bitcoin ........................ ${BUILD_TESTS}")
503509
message(" bench_bitcoin ....................... ${BUILD_BENCH}")

cmake/bitcoin-config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@
141141
/* Define if BDB support should be compiled in */
142142
#cmakedefine USE_BDB 1
143143

144+
/* Define if dbus support should be compiled in */
145+
#cmakedefine USE_DBUS 1
146+
144147
/* Define if QR support should be compiled in */
145148
#cmakedefine USE_QRCODE 1
146149

src/qt/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@ if(ENABLE_WALLET)
214214
)
215215
endif()
216216

217+
if(WITH_DBUS)
218+
target_link_libraries(bitcoinqt PRIVATE Qt5::DBus)
219+
endif()
220+
217221
if(qt_lib_type STREQUAL "STATIC_LIBRARY")
218222
# We want to define static plugins to link ourselves, thus preventing
219223
# automatic linking against a "sane" set of default static plugins.

0 commit comments

Comments
 (0)