diff --git a/CMakeLists.txt b/CMakeLists.txt index c9b7118030..499cee345a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -144,6 +144,13 @@ endif() cmake_dependent_option(ENABLE_EXTERNAL_SIGNER "Enable external signer support." ON "NOT WIN32" OFF) +cmake_dependent_option(WITH_QRENCODE "Enable QR code support." ON "BUILD_GUI" OFF) +if(WITH_QRENCODE) + find_package(PkgConfig REQUIRED) + pkg_check_modules(libqrencode REQUIRED IMPORTED_TARGET libqrencode) + set(USE_QRCODE TRUE) +endif() + if(BUILD_GUI) set(qt_components Core Gui Widgets LinguistTools) if(ENABLE_WALLET) @@ -490,6 +497,7 @@ message(" - using NAT-PMP .................... ${WITH_NATPMP}") message(" - using UPnP ....................... ${WITH_MINIUPNPC}") message(" ZeroMQ .............................. ${WITH_ZMQ}") message(" USDT tracing ........................ ${WITH_USDT}") +message(" QR code (GUI) ....................... ${WITH_QRENCODE}") message("Tests:") message(" test_bitcoin ........................ ${BUILD_TESTS}") message(" bench_bitcoin ....................... ${BUILD_BENCH}") diff --git a/cmake/bitcoin-config.h.in b/cmake/bitcoin-config.h.in index f599efc89f..dc030a24e6 100644 --- a/cmake/bitcoin-config.h.in +++ b/cmake/bitcoin-config.h.in @@ -141,6 +141,9 @@ /* Define if BDB support should be compiled in */ #cmakedefine USE_BDB 1 +/* Define if QR support should be compiled in */ +#cmakedefine USE_QRCODE 1 + /* Define if sqlite support should be compiled in */ #cmakedefine USE_SQLITE 1