Merge bitcoin/bitcoin#30454: build: Introduce CMake-based build system

41051290ab cmake: Ignore build subdirectories within source directory (Hennadii Stepanov)
6ce50fd9d0 doc: Update for CMake-based build system (Hennadii Stepanov)
9730288a0c ci: Migrate CI scripts to CMake (Hennadii Stepanov)
c360837ca5 cmake, lint: Adjust `lint_includes_build_config` (Hennadii Stepanov)
3885441ee0 cmake: Add presets for native Windows builds (Hennadii Stepanov)
7681746b20 cmake: Add vcpkg manifest file (Hennadii Stepanov)
8b6f1c4353 cmake: Add `Coverage` and `CoverageFuzz` scripts (Hennadii Stepanov)
65bdbc1ff2 cmake: Add `docs` build target (Hennadii Stepanov)
fb75ebbc33 cmake: Add compiler diagnostic flags (Hennadii Stepanov)
e821f0a37a cmake: Migrate Guix build scripts to CMake (Hennadii Stepanov)
747adb6ffe cmake: Add `Maintenance` module (Hennadii Stepanov)
1f60b30df0 cmake: Add `APPEND_{CPP,C,CXX,LD}FLAGS` cache variables (Hennadii Stepanov)
2b43c45b13 cmake: Add `AddWindowsResources` module (Hennadii Stepanov)
973a3b0c5d cmake: Implement `install` build target (Hennadii Stepanov)
84ac35cfd4 cmake: Add cross-compiling support (Hennadii Stepanov)
0d01c228a7 build: Generate `toolchain.cmake` in depends (Hennadii Stepanov)
91a799247d depends: Add host-specific `cmake_system_version` variables (Hennadii Stepanov)
9b31209b4c depends: Rename `cmake_system` -> `cmake_system_name` (Hennadii Stepanov)
4a5208a81d Revert "build, qt: Do not install *.prl files" (Hennadii Stepanov)
6522af62af depends: Amend handling flags environment variables (Hennadii Stepanov)
90cec4d251 cmake: Add `MULTIPROCESS` option (Hennadii Stepanov)
bb1a450dcb cmake: Build `bitcoin-chainstate` executable (Hennadii Stepanov)
aed38ea58c cmake: Build `bitcoinkernel` library (Hennadii Stepanov)
975d67369b cmake: Build `test_bitcoin-qt` executable (Hennadii Stepanov)
10fcc668a3 cmake: Add `WITH_DBUS` option (Hennadii Stepanov)
5bb5a4bc75 cmake: Add `libqrencode` optional package support (Hennadii Stepanov)
57a6e2ef4a cmake: Build `bitcoin-qt` executable (Hennadii Stepanov)
30f642952c cmake: Add `WERROR` option (Hennadii Stepanov)
c98d4a4c34 cmake: Add `REDUCE_EXPORTS` option (Hennadii Stepanov)
a01cb6e63f cmake: Add `HARDENING` option (Hennadii Stepanov)
a8a2e364ac cmake: Add Python-based tests (Hennadii Stepanov)
3d85379570 cmake: Add fuzzing options (Hennadii Stepanov)
908530e312 cmake: Add `SANITIZERS` option (Hennadii Stepanov)
8bb0e85631 cmake: Build `bench_bitcoin` executable (Hennadii Stepanov)
801735163a cmake: Add external signer support (Hennadii Stepanov)
353e0c9e96 cmake: Add `systemtap-sdt` optional package support (Hennadii Stepanov)
d2fda82b49 cmake: Add `libzmq` optional package support (Hennadii Stepanov)
ae7b39a0e1 cmake: Add `libminiupnpc` optional package support (Hennadii Stepanov)
6480e1dcdb cmake: Add `libnatpmp` optional package support (Hennadii Stepanov)
e73e9304a1 cmake: Build `bitcoin-util` executable (Hennadii Stepanov)
027c6d7caa cmake: Build `bitcoin-tx` executable (Hennadii Stepanov)
d10c5c34c3 cmake: Add wallet functionality (Hennadii Stepanov)
ab2e99b0d9 cmake: Create test suite for `ctest` (Hennadii Stepanov)
959370bd76 cmake: Build `test_bitcoin` executable (Hennadii Stepanov)
b27bf9700d cmake: Build `bitcoin-cli` executable (Hennadii Stepanov)
a9813df826 cmake: Build `bitcoind` executable (Hennadii Stepanov)
97829ce2d5 cmake: Add `FindLibevent` module (Hennadii Stepanov)
3118e40c61 cmake: Build `bitcoin_consensus` library (Hennadii Stepanov)
809a2f1929 cmake: Build `bitcoin_util` static library (Hennadii Stepanov)
0a9a521a70 cmake: Build `bitcoin_crypto` library (Hennadii Stepanov)
958971f476 cmake: Build `univalue` static library (Hennadii Stepanov)
752747fda8 cmake: Generate `obj/build.h` header (Hennadii Stepanov)
1f0a78edf3 cmake: Build `minisketch` static library (Hennadii Stepanov)
12bfbc8154 cmake: Build `leveldb` static library (Hennadii Stepanov)
51985c5304 cmake: Build `crc32c` static library (Hennadii Stepanov)
db7a198f29 cmake: Build `secp256k1` subtree (Hennadii Stepanov)
dbb7ed14e8 cmake: Add `ccache` support (Hennadii Stepanov)
cedfdf6c72 cmake: Redefine/adjust per-configuration flags (Hennadii Stepanov)
b6b5e732c8 cmake: Add global compiler and linker flags (Hennadii Stepanov)
f98327931b cmake: Add `TryAppendLinkerFlag` module (Hennadii Stepanov)
4a0af29697 cmake: Add `TryAppendCXXFlags` module (Hennadii Stepanov)
35cffc497d cmake: Add POSIX threads support (Hennadii Stepanov)
fd72d00ffe cmake: Add position independent code support (Hennadii Stepanov)
07069e2bb0 cmake: Add introspection module (Hennadii Stepanov)
27d687fc1f cmake: Add `config/bitcoin-config.h` support (Hennadii Stepanov)
fe5cdace5f cmake: Print compiler and linker flags in summary (Hennadii Stepanov)
70683884c5 cmake: Introduce interface libraries to encapsulate common flags (Hennadii Stepanov)
a2317e27b7 cmake: Add root `CMakeLists.txt` file (Hennadii Stepanov)

Pull request description:

  This PR introduces a new CMake-based build system, which is a drop-in replacement for the current Autotools-based build system.

  ML announcement: https://groups.google.com/g/bitcoindev/c/hgKkfQWzrTo

  As discussed during the recent CoreDev meetup in April, the switch from Autotools to CMake is intended to happen as soon as possible after branching 28.x off, which means that 29.0 will be built using CMake.

  This PR branch is essentially the [staging branch](https://github.com/hebasto/bitcoin/tree/cmake-staging), with every change reviewed and tested by a group of contributors, including (in alphabetical order):
  - [**achow101**](https://github.com/achow101)
  - [**fanquake**](https://github.com/fanquake)
  - [**maflcko**](https://github.com/maflcko)
  - [**m3dwards**](https://github.com/m3dwards)
  - [**pablomartin4btc**](https://github.com/pablomartin4btc)
  - [**real-or-random**](https://github.com/real-or-random)
  - [**ryanofsky**](https://github.com/ryanofsky)
  - [**sipsorcery**](https://github.com/sipsorcery)
  - [**TheCharlatan**](https://github.com/TheCharlatan)
  - [**theStack**](https://github.com/theStack)
  - [**theuni**](https://github.com/theuni)
  - [**vasild**](https://github.com/vasild)

  Reviewing in a separate staging repo was suggested in https://github.com/bitcoin/bitcoin/pull/27060#issuecomment-1431798320.

  The accompanying changes to the OSS-Fuzz project are available in https://github.com/hebasto/oss-fuzz/pull/8.

  Please refer to the [build options parity table](https://gist.github.com/hebasto/2ef97d3a726bfce08ded9df07f7dab5e). The "auto" value is no longer available; non-default values must be specified explicitly. Additionally, the new default values have been chosen to suit the everyday build experience for the majority of developers.

  System requirements for using the CMake-based build system:
  - CMake >= 3.22 (if not available in your system's repository, it can be downloaded from https://cmake.org/download/)
  - a build tool of your choice:
  - any Make (GNU Make is no longer a requirement); GNU Make is still required to build depends
  - Ninja (https://ninja-build.org/)
  - MSBuild
  - Xcode

  A note for Windows users: The default installation of the latest version of MSVC 17.10.4 includes both CMake 3.28.3 and the vcpkg package manager).

  ---

  We, the build system developers, kindly ask reviewers to refrain from making suggestions that are not directly related to the migration process or can be implemented separately. Bugs in the scripts and errors in the updated documentation should be the focus of this PR. Please be advised that comments not aligned with this PR's goal may be ignored.

  Thank you all for your understanding.

ACKs for top commit:
  maflcko:
    review ACK 41051290ab 🐥
  sipsorcery:
    ACK 41051290ab.
  vasild:
    ACK 41051290ab
  TheCharlatan:
    ACK 41051290ab
  pablomartin4btc:
    tACK 41051290ab
  i-am-yuvi:
    tACK [`4105129`](41051290ab)
  theuni:
    ACK 41051290ab.
  fanquake:
    ACK 41051290ab

Tree-SHA512: 6c1445054436c6c00ad63bfa0f19d64091a2b25c9bd694f85bf2218ac358ffb774d6c000685b3ca1e9b50401babed989fa2a0694b774c211d226bfd1944c9b39
This commit is contained in:
merge-script
2024-08-28 10:51:24 +01:00
113 changed files with 5878 additions and 524 deletions

334
src/qt/CMakeLists.txt Normal file
View File

@@ -0,0 +1,334 @@
# Copyright (c) 2023-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit/.
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
enable_language(OBJCXX)
set(CMAKE_OBJCXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
set(CMAKE_OBJCXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_OBJCXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_OBJCXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")
string(APPEND CMAKE_OBJCXX_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CXXFLAGS}")
endif()
get_target_property(qt_lib_type Qt5::Core TYPE)
# TODO: After the transition from Autotools to CMake,
# all `Q_IMPORT_PLUGIN` macros can be deleted from the
# qt/bitcoin.cpp and qt/test/test_main.cpp source files.
function(import_plugins target)
if(qt_lib_type STREQUAL "STATIC_LIBRARY")
set(plugins Qt5::QMinimalIntegrationPlugin)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND plugins Qt5::QXcbIntegrationPlugin)
elseif(WIN32)
list(APPEND plugins Qt5::QWindowsIntegrationPlugin Qt5::QWindowsVistaStylePlugin)
elseif(APPLE)
list(APPEND plugins Qt5::QCocoaIntegrationPlugin Qt5::QMacStylePlugin)
endif()
qt5_import_plugins(${target}
INCLUDE ${plugins}
EXCLUDE_BY_TYPE imageformats iconengines
)
endif()
endfunction()
# For Qt-specific commands and variables, please consult:
# - https://cmake.org/cmake/help/latest/manual/cmake-qt.7.html
# - https://doc.qt.io/qt-5/cmake-manual.html
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOUIC_SEARCH_PATHS forms)
# TODO: The file(GLOB ...) command should be replaced with an explicit
# file list. Such a change must be synced with the corresponding change
# to https://github.com/bitcoin-core/bitcoin-maintainer-tools/blob/main/update-translations.py
file(GLOB ts_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} locale/*.ts)
set_source_files_properties(${ts_files} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/locale)
qt5_add_translation(qm_files ${ts_files})
configure_file(bitcoin_locale.qrc bitcoin_locale.qrc COPYONLY)
# The bitcoinqt sources have to include headers in
# order to parse them to collect translatable strings.
add_library(bitcoinqt STATIC EXCLUDE_FROM_ALL
bantablemodel.cpp
bantablemodel.h
bitcoin.cpp
bitcoin.h
bitcoinaddressvalidator.cpp
bitcoinaddressvalidator.h
bitcoinamountfield.cpp
bitcoinamountfield.h
bitcoingui.cpp
bitcoingui.h
bitcoinunits.cpp
bitcoinunits.h
clientmodel.cpp
clientmodel.h
csvmodelwriter.cpp
csvmodelwriter.h
guiutil.cpp
guiutil.h
initexecutor.cpp
initexecutor.h
intro.cpp
intro.h
$<$<PLATFORM_ID:Darwin>:macdockiconhandler.h>
$<$<PLATFORM_ID:Darwin>:macdockiconhandler.mm>
$<$<PLATFORM_ID:Darwin>:macnotificationhandler.h>
$<$<PLATFORM_ID:Darwin>:macnotificationhandler.mm>
$<$<PLATFORM_ID:Darwin>:macos_appnap.h>
$<$<PLATFORM_ID:Darwin>:macos_appnap.mm>
modaloverlay.cpp
modaloverlay.h
networkstyle.cpp
networkstyle.h
notificator.cpp
notificator.h
optionsdialog.cpp
optionsdialog.h
optionsmodel.cpp
optionsmodel.h
peertablemodel.cpp
peertablemodel.h
peertablesortproxy.cpp
peertablesortproxy.h
platformstyle.cpp
platformstyle.h
qvalidatedlineedit.cpp
qvalidatedlineedit.h
qvaluecombobox.cpp
qvaluecombobox.h
rpcconsole.cpp
rpcconsole.h
splashscreen.cpp
splashscreen.h
trafficgraphwidget.cpp
trafficgraphwidget.h
utilitydialog.cpp
utilitydialog.h
$<$<PLATFORM_ID:Windows>:winshutdownmonitor.cpp>
$<$<PLATFORM_ID:Windows>:winshutdownmonitor.h>
bitcoin.qrc
${CMAKE_CURRENT_BINARY_DIR}/bitcoin_locale.qrc
)
target_compile_definitions(bitcoinqt
PUBLIC
QT_NO_KEYWORDS
QT_USE_QSTRINGBUILDER
)
target_include_directories(bitcoinqt
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
)
set_property(SOURCE macnotificationhandler.mm
# Ignore warnings "'NSUserNotificationCenter' is deprecated: first deprecated in macOS 11.0".
APPEND PROPERTY COMPILE_OPTIONS -Wno-deprecated-declarations
)
target_link_libraries(bitcoinqt
PUBLIC
Qt5::Widgets
PRIVATE
core_interface
bitcoin_cli
leveldb
Boost::headers
$<TARGET_NAME_IF_EXISTS:NATPMP::NATPMP>
$<TARGET_NAME_IF_EXISTS:MiniUPnPc::MiniUPnPc>
$<TARGET_NAME_IF_EXISTS:PkgConfig::libqrencode>
$<$<PLATFORM_ID:Darwin>:-framework\ AppKit>
$<$<CXX_COMPILER_ID:MSVC>:shlwapi>
)
if(ENABLE_WALLET)
target_sources(bitcoinqt
PRIVATE
addressbookpage.cpp
addressbookpage.h
addresstablemodel.cpp
addresstablemodel.h
askpassphrasedialog.cpp
askpassphrasedialog.h
coincontroldialog.cpp
coincontroldialog.h
coincontroltreewidget.cpp
coincontroltreewidget.h
createwalletdialog.cpp
createwalletdialog.h
editaddressdialog.cpp
editaddressdialog.h
openuridialog.cpp
openuridialog.h
overviewpage.cpp
overviewpage.h
paymentserver.cpp
paymentserver.h
psbtoperationsdialog.cpp
psbtoperationsdialog.h
qrimagewidget.cpp
qrimagewidget.h
receivecoinsdialog.cpp
receivecoinsdialog.h
receiverequestdialog.cpp
receiverequestdialog.h
recentrequeststablemodel.cpp
recentrequeststablemodel.h
sendcoinsdialog.cpp
sendcoinsdialog.h
sendcoinsentry.cpp
sendcoinsentry.h
signverifymessagedialog.cpp
signverifymessagedialog.h
transactiondesc.cpp
transactiondesc.h
transactiondescdialog.cpp
transactiondescdialog.h
transactionfilterproxy.cpp
transactionfilterproxy.h
transactionoverviewwidget.cpp
transactionoverviewwidget.h
transactionrecord.cpp
transactionrecord.h
transactiontablemodel.cpp
transactiontablemodel.h
transactionview.cpp
transactionview.h
walletcontroller.cpp
walletcontroller.h
walletframe.cpp
walletframe.h
walletmodel.cpp
walletmodel.h
walletmodeltransaction.cpp
walletmodeltransaction.h
walletview.cpp
walletview.h
)
target_link_libraries(bitcoinqt
PRIVATE
bitcoin_wallet
Qt5::Network
)
endif()
if(WITH_DBUS)
target_link_libraries(bitcoinqt PRIVATE Qt5::DBus)
endif()
if(qt_lib_type STREQUAL "STATIC_LIBRARY")
# We want to define static plugins to link ourselves, thus preventing
# automatic linking against a "sane" set of default static plugins.
qt5_import_plugins(bitcoinqt
EXCLUDE_BY_TYPE bearer iconengines imageformats platforms styles
)
endif()
add_executable(bitcoin-qt
main.cpp
../init/bitcoin-qt.cpp
)
add_windows_resources(bitcoin-qt res/bitcoin-qt-res.rc)
target_link_libraries(bitcoin-qt
core_interface
bitcoinqt
bitcoin_node
)
import_plugins(bitcoin-qt)
set(installable_targets bitcoin-qt)
if(WIN32)
set_target_properties(bitcoin-qt PROPERTIES WIN32_EXECUTABLE TRUE)
endif()
if(WITH_MULTIPROCESS)
add_executable(bitcoin-gui
main.cpp
../init/bitcoin-gui.cpp
)
target_link_libraries(bitcoin-gui
core_interface
bitcoinqt
bitcoin_node
bitcoin_ipc
)
import_plugins(bitcoin-gui)
list(APPEND installable_targets bitcoin-gui)
if(WIN32)
set_target_properties(bitcoin-gui PROPERTIES WIN32_EXECUTABLE TRUE)
endif()
endif()
install(TARGETS ${installable_targets}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
COMPONENT GUI
)
if(BUILD_GUI_TESTS)
add_subdirectory(test)
endif()
# Gets sources to be parsed to gather translatable strings.
function(get_translatable_sources var)
set(result)
set(targets)
foreach(dir IN ITEMS ${ARGN})
get_directory_property(dir_targets DIRECTORY ${PROJECT_SOURCE_DIR}/${dir} BUILDSYSTEM_TARGETS)
list(APPEND targets ${dir_targets})
endforeach()
foreach(target IN LISTS targets)
get_target_property(target_sources ${target} SOURCES)
if(target_sources)
foreach(source IN LISTS target_sources)
# Get an expression from the generator expression, if any.
if(source MATCHES ":([^>]+)>$")
set(source ${CMAKE_MATCH_1})
endif()
cmake_path(GET source EXTENSION LAST_ONLY ext)
if(ext STREQUAL ".qrc")
continue()
endif()
if(NOT IS_ABSOLUTE source)
get_target_property(target_source_dir ${target} SOURCE_DIR)
cmake_path(APPEND target_source_dir ${source} OUTPUT_VARIABLE source)
endif()
list(APPEND result ${source})
endforeach()
endif()
endforeach()
set(${var} ${result} PARENT_SCOPE)
endfunction()
find_program(XGETTEXT_EXECUTABLE xgettext)
find_program(SED_EXECUTABLE sed)
if(NOT XGETTEXT_EXECUTABLE)
add_custom_target(translate
COMMAND ${CMAKE_COMMAND} -E echo "Error: GNU gettext-tools not found"
)
elseif(NOT SED_EXECUTABLE)
add_custom_target(translate
COMMAND ${CMAKE_COMMAND} -E echo "Error: GNU sed not found"
)
else()
set(translatable_sources_directories src src/qt src/util)
if(ENABLE_WALLET)
list(APPEND translatable_sources_directories src/wallet)
endif()
get_translatable_sources(translatable_sources ${translatable_sources_directories})
get_translatable_sources(qt_translatable_sources src/qt)
file(GLOB ui_files ${CMAKE_CURRENT_SOURCE_DIR}/forms/*.ui)
add_custom_target(translate
COMMAND ${CMAKE_COMMAND} -E env XGETTEXT=${XGETTEXT_EXECUTABLE} COPYRIGHT_HOLDERS=${COPYRIGHT_HOLDERS} ${Python3_EXECUTABLE} ${PROJECT_SOURCE_DIR}/share/qt/extract_strings_qt.py ${translatable_sources}
COMMAND Qt5::lupdate -no-obsolete -I ${PROJECT_SOURCE_DIR}/src -locations relative ${CMAKE_CURRENT_SOURCE_DIR}/bitcoinstrings.cpp ${ui_files} ${qt_translatable_sources} -ts ${CMAKE_CURRENT_SOURCE_DIR}/locale/bitcoin_en.ts
COMMAND Qt5::lconvert -drop-translations -o ${CMAKE_CURRENT_SOURCE_DIR}/locale/bitcoin_en.xlf -i ${CMAKE_CURRENT_SOURCE_DIR}/locale/bitcoin_en.ts
COMMAND ${SED_EXECUTABLE} -i.old -e "s|source-language=\"en\" target-language=\"en\"|source-language=\"en\"|" -e "/<target xml:space=\"preserve\"><\\/target>/d" ${CMAKE_CURRENT_SOURCE_DIR}/locale/bitcoin_en.xlf
COMMAND ${CMAKE_COMMAND} -E rm ${CMAKE_CURRENT_SOURCE_DIR}/locale/bitcoin_en.xlf.old
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src
VERBATIM
)
endif()

View File

@@ -4,7 +4,7 @@ The current precise version for Qt 5 is specified in [qt.mk](/depends/packages/q
## Compile and run
See build instructions: [Unix](/doc/build-unix.md), [macOS](/doc/build-osx.md), [Windows](/doc/build-windows.md), [FreeBSD](/doc/build-freebsd.md), [NetBSD](/doc/build-netbsd.md), [OpenBSD](/doc/build-openbsd.md)
See build instructions: [Unix](/doc/build-unix.md), [macOS](/doc/build-osx.md), [Windows](/doc/build-windows-msvc.md), [FreeBSD](/doc/build-freebsd.md), [NetBSD](/doc/build-netbsd.md), [OpenBSD](/doc/build-openbsd.md)
When following your systems build instructions, make sure to install the `Qt` dependencies.

View File

@@ -0,0 +1,56 @@
# Copyright (c) 2024-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit/.
add_executable(test_bitcoin-qt
apptests.cpp
optiontests.cpp
rpcnestedtests.cpp
test_main.cpp
uritests.cpp
util.cpp
../../init/bitcoin-qt.cpp
)
target_link_libraries(test_bitcoin-qt
core_interface
bitcoinqt
test_util
bitcoin_node
Boost::headers
Qt5::Test
)
import_plugins(test_bitcoin-qt)
if(ENABLE_WALLET)
target_sources(test_bitcoin-qt
PRIVATE
addressbooktests.cpp
wallettests.cpp
../../wallet/test/wallet_test_fixture.cpp
)
endif()
if(NOT QT_IS_STATIC)
add_custom_command(
TARGET test_bitcoin-qt POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_PROPERTY:Qt5::QMinimalIntegrationPlugin,LOCATION_$<UPPER_CASE:$<CONFIG>>> $<TARGET_FILE_DIR:test_bitcoin-qt>/plugins/platforms
VERBATIM
)
endif()
add_test(NAME test_bitcoin-qt
COMMAND test_bitcoin-qt
)
if(WIN32 AND VCPKG_TARGET_TRIPLET)
# On Windows, vcpkg configures Qt with `-opengl dynamic`, which makes
# the "minimal" platform plugin unusable due to internal Qt bugs.
set_tests_properties(test_bitcoin-qt PROPERTIES
ENVIRONMENT "QT_QPA_PLATFORM=windows"
)
endif()
install(TARGETS test_bitcoin-qt
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)