diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,6 +22,7 @@ option(ENABLE_GLIBC_BACK_COMPAT "Enable Glibc compatibility features" OFF) option(ENABLE_QRCODE "Enable QR code display" ON) option(ENABLE_UPNP "Enable UPnP support" ON) +option(ENABLE_NOTIFICATIONS "Enable desktop notifications" ON) option(START_WITH_UPNP "Make UPnP the default to map ports" OFF) # Allow usage of sanitizers by setting ECM_ENABLE_SANITIZERS diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -222,5 +222,9 @@ set(USE_UPNP ${START_WITH_UPNP} CACHE INTERNAL "UPnP is enabled") endif() +if(ENABLE_NOTIFICATIONS) + set(USE_DBUS 1) +endif() + # Generate the config configure_file(bitcoin-config.h.cmake.in bitcoin-config.h ESCAPE_QUOTES) diff --git a/src/config/bitcoin-config.h.cmake.in b/src/config/bitcoin-config.h.cmake.in --- a/src/config/bitcoin-config.h.cmake.in +++ b/src/config/bitcoin-config.h.cmake.in @@ -75,4 +75,7 @@ #cmakedefine01 USE_UPNP #endif +/* Define if QtDBus support should be enabled */ +#cmakedefine USE_DBUS 1 + #endif // BITCOIN_BITCOIN_CONFIG_H diff --git a/src/qt/CMakeLists.txt b/src/qt/CMakeLists.txt --- a/src/qt/CMakeLists.txt +++ b/src/qt/CMakeLists.txt @@ -9,6 +9,10 @@ find_brew_prefix(QT5_PREFIX qt5) set(QT_REQUIRED_COMPONENTS Core Widgets Network Test) +if(ENABLE_NOTIFICATIONS) + list(APPEND QT_REQUIRED_COMPONENTS DBus) +endif() + find_package(Qt5 COMPONENTS ${QT_REQUIRED_COMPONENTS} REQUIRED HINTS "${QT5_PREFIX}") # Localisation @@ -230,6 +234,9 @@ OpenSSL::SSL ${Protobuf_LIBRARIES} ) +if(ENABLE_NOTIFICATIONS) + target_link_libraries(bitcoin-qt-base Qt5::DBus) +endif() # Wallet if(BUILD_BITCOIN_WALLET)