Skip to content
Bitcoin Roots

v31.1-roots.1 · Commit 1: [PATCH 01/17] build(roots): establish v31 portability foundation

CMakeLists.txt

Before: CMakeLists.txt · After: CMakeLists.txt

File metadata
index 6109639f00390e2bbd050d8cfed69320bf1ec159..4bfd4a3c1ab62c7f69fa7a22d862ec6a20cd85ac 100644

Download original patch · Release notes

Diff rows 1–69 of 69. Line numbers refer to the original before/after files.

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.

CMakeLists.txt CHANGED
@@ -112,6 +112,20 @@ option(BUILD_UTIL_CHAINSTATE "Build experimental bitcoin-chainstate executable."
112
112
  option(BUILD_KERNEL_LIB "Build experimental bitcoinkernel library." ${BUILD_UTIL_CHAINSTATE})
113
113
  cmake_dependent_option(BUILD_KERNEL_TEST "Build tests for the experimental bitcoinkernel library." ON "BUILD_KERNEL_LIB" OFF)
114
114
 
115
+ option(WITH_SYSTEM_LEVELDB "Build with system LevelDB instead of the embedded fork." OFF)
116
+ mark_as_advanced(WITH_SYSTEM_LEVELDB)
117
+ set(EMBEDDED_LEVELDB TRUE)
118
+ if(WITH_SYSTEM_LEVELDB)
119
+ set(EMBEDDED_LEVELDB FALSE)
120
+ find_package(LevelDB MODULE REQUIRED)
121
+ endif()
122
+
123
+ option(WITH_SYSTEM_LIBSECP256K1 "Build with system libsecp256k1 instead of the embedded copy." OFF)
124
+ mark_as_advanced(WITH_SYSTEM_LIBSECP256K1)
125
+ if(WITH_SYSTEM_LIBSECP256K1)
126
+ include(CheckSystemSecp256k1)
127
+ endif()
128
+
115
129
  option(ENABLE_WALLET "Enable wallet." ON)
116
130
  if(ENABLE_WALLET)
117
131
  if(VCPKG_TARGET_TRIPLET)
@@ -136,6 +150,11 @@ if(WITH_ZMQ)
136
150
  find_package(ZeroMQ 4.0.0 MODULE REQUIRED)
137
151
  endif()
138
152
 
153
+ option(WITH_MINIUPNPC "Discover MiniUPnPc for deferred Roots UPnP integration." OFF)
154
+ if(WITH_MINIUPNPC)
155
+ find_package(MiniUPnPc MODULE REQUIRED)
156
+ endif()
157
+
139
158
  option(WITH_EMBEDDED_ASMAP "Embed default ASMap data." ON)
140
159
 
141
160
  option(WITH_USDT "Enable tracepoints for Userspace, Statically Defined Tracing." OFF)
@@ -163,6 +182,11 @@ if(ENABLE_IPC AND WITH_EXTERNAL_LIBMULTIPROCESS)
163
182
  endif()
164
183
 
165
184
  cmake_dependent_option(BUILD_GUI_TESTS "Build test_bitcoin-qt executable." ON "BUILD_GUI;BUILD_TESTS" OFF)
185
+ set(WITH_QT_VERSION "6" CACHE STRING "Qt major version to use for GUI builds (5 or 6).")
186
+ set_property(CACHE WITH_QT_VERSION PROPERTY STRINGS 5 6)
187
+ if(NOT WITH_QT_VERSION MATCHES "^[56]$")
188
+ message(FATAL_ERROR "WITH_QT_VERSION must be 5 or 6.")
189
+ endif()
166
190
  if(BUILD_GUI)
167
191
  set(qt_components Core Gui Widgets LinguistTools)
168
192
  if(ENABLE_WALLET)
@@ -175,9 +199,15 @@ if(BUILD_GUI)
175
199
  if(BUILD_GUI_TESTS)
176
200
  list(APPEND qt_components Test)
177
201
  endif()
178
- find_package(Qt 6.2 MODULE REQUIRED
202
+ if(WITH_QT_VERSION STREQUAL "5")
203
+ set(qt_min_version 5.11.3)
204
+ else()
205
+ set(qt_min_version 6.2)
206
+ endif()
207
+ find_package(Qt ${qt_min_version} MODULE REQUIRED
179
208
  COMPONENTS ${qt_components}
180
209
  )
210
+ unset(qt_min_version)
181
211
  unset(qt_components)
182
212
  endif()
183
213
 
@@ -670,6 +700,11 @@ message(" Embedded ASMap ...................... ${WITH_EMBEDDED_ASMAP}")
670
700
  message(" USDT tracing ........................ ${WITH_USDT}")
671
701
  message(" QR code (GUI) ....................... ${WITH_QRENCODE}")
672
702
  message(" DBus (GUI) .......................... ${WITH_DBUS}")
703
+ message(" Qt major version (GUI) .............. ${WITH_QT_VERSION}")
704
+ message(" System LevelDB ...................... ${WITH_SYSTEM_LEVELDB}")
705
+ message(" System libsecp256k1 .................. ${WITH_SYSTEM_LIBSECP256K1}")
706
+ message(" MiniUPnPc dependency ................ ${WITH_MINIUPNPC} (UPnP runtime deferred)")
707
+ message(" Deferred Roots behavior ............. see doc/roots-features.md")
673
708
  message("Tests:")
674
709
  message(" test_bitcoin ........................ ${BUILD_TESTS}")
675
710
  message(" test_bitcoin-qt ..................... ${BUILD_GUI_TESTS}")