Skip to content

Commit 5bb5a4b

Browse files
committed
cmake: Add libqrencode optional package support
1 parent 57a6e2e commit 5bb5a4b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ endif()
144144

145145
cmake_dependent_option(ENABLE_EXTERNAL_SIGNER "Enable external signer support." ON "NOT WIN32" OFF)
146146

147+
cmake_dependent_option(WITH_QRENCODE "Enable QR code support." ON "BUILD_GUI" OFF)
148+
if(WITH_QRENCODE)
149+
find_package(PkgConfig REQUIRED)
150+
pkg_check_modules(libqrencode REQUIRED IMPORTED_TARGET libqrencode)
151+
set(USE_QRCODE TRUE)
152+
endif()
153+
147154
if(BUILD_GUI)
148155
set(qt_components Core Gui Widgets LinguistTools)
149156
if(ENABLE_WALLET)
@@ -490,6 +497,7 @@ message(" - using NAT-PMP .................... ${WITH_NATPMP}")
490497
message(" - using UPnP ....................... ${WITH_MINIUPNPC}")
491498
message(" ZeroMQ .............................. ${WITH_ZMQ}")
492499
message(" USDT tracing ........................ ${WITH_USDT}")
500+
message(" QR code (GUI) ....................... ${WITH_QRENCODE}")
493501
message("Tests:")
494502
message(" test_bitcoin ........................ ${BUILD_TESTS}")
495503
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 QR support should be compiled in */
145+
#cmakedefine USE_QRCODE 1
146+
144147
/* Define if sqlite support should be compiled in */
145148
#cmakedefine USE_SQLITE 1
146149

0 commit comments

Comments
 (0)