Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1# Copyright (c) 2023-present The Bitcoin Core developers2# Distributed under the MIT software license, see the accompanying3# file COPYING or https://opensource.org/license/mit/.5if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")6enable_language(OBJCXX)7set(CMAKE_OBJCXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")8set(CMAKE_OBJCXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")9set(CMAKE_OBJCXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")10set(CMAKE_OBJCXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}")11string(APPEND CMAKE_OBJCXX_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CXXFLAGS}")12endif()14get_target_property(qt_lib_type Qt6::Core TYPE)16function(import_plugins target)17if(qt_lib_type STREQUAL "STATIC_LIBRARY")18set(plugins Qt6::QMinimalIntegrationPlugin)19if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|FreeBSD|OpenBSD)$")20list(APPEND plugins Qt6::QXcbIntegrationPlugin)21elseif(WIN32)22list(APPEND plugins Qt6::QWindowsIntegrationPlugin Qt6::QModernWindowsStylePlugin)23elseif(APPLE)24list(APPEND plugins Qt6::QCocoaIntegrationPlugin Qt6::QMacStylePlugin)25endif()26qt6_import_plugins(${target}27INCLUDE ${plugins}28EXCLUDE_BY_TYPE29accessiblebridge30platforms31platforms_darwin32xcbglintegrations33platformthemes34platforminputcontexts35generic36iconengines37imageformats38egldeviceintegrations39styles40networkaccess41networkinformation42tls43)44endif()45endfunction()47# For Qt-specific commands and variables, please consult:48# - https://cmake.org/cmake/help/latest/manual/cmake-qt.7.html49# - https://doc.qt.io/qt-5/cmake-manual.html51set(CMAKE_AUTOMOC ON)52set(CMAKE_AUTOMOC_MOC_OPTIONS "-p${CMAKE_CURRENT_SOURCE_DIR}")53set(CMAKE_AUTOUIC ON)54set(CMAKE_AUTOUIC_SEARCH_PATHS forms)56set(CMAKE_AUTORCC OFF)57configure_file(bitcoin_locale.qrc bitcoin_locale.qrc USE_SOURCE_PERMISSIONS COPYONLY)58qt6_add_resources(BITCOIN_QRC bitcoin.qrc)59qt6_add_resources(BITCOIN_LOCALE_QRC ${CMAKE_CURRENT_BINARY_DIR}/bitcoin_locale.qrc)60# See: https://bugreports.qt.io/browse/QTBUG-141858.61get_target_property(warn_flags warn_interface INTERFACE_COMPILE_OPTIONS)62if("-Wtrailing-whitespace=any" IN_LIST warn_flags)63set_source_files_properties(${BITCOIN_QRC} ${BITCOIN_LOCALE_QRC} PROPERTIES COMPILE_OPTIONS -Wno-trailing-whitespace)64endif()65unset(warn_flags)67# The bitcoinqt sources have to include headers in68# order to parse them to collect translatable strings.69add_library(bitcoinqt STATIC EXCLUDE_FROM_ALL70bantablemodel.cpp71bantablemodel.h72bitcoin.cpp73bitcoin.h74bitcoinaddressvalidator.cpp75bitcoinaddressvalidator.h76bitcoinamountfield.cpp77bitcoinamountfield.h78bitcoingui.cpp79bitcoingui.h80bitcoinunits.cpp81bitcoinunits.h82clientmodel.cpp83clientmodel.h84csvmodelwriter.cpp85csvmodelwriter.h86freespacechecker.cpp87freespacechecker.h88guiutil.cpp89guiutil.h90initexecutor.cpp91initexecutor.h92intro.cpp93intro.h94$<$<PLATFORM_ID:Darwin>:macdockiconhandler.h>95$<$<PLATFORM_ID:Darwin>:macdockiconhandler.mm>96$<$<PLATFORM_ID:Darwin>:macnotificationhandler.h>97$<$<PLATFORM_ID:Darwin>:macnotificationhandler.mm>98$<$<PLATFORM_ID:Darwin>:macos_appnap.h>99$<$<PLATFORM_ID:Darwin>:macos_appnap.mm>100modaloverlay.cpp101modaloverlay.h102networkstyle.cpp103networkstyle.h104notificator.cpp105notificator.h106optionsdialog.cpp107optionsdialog.h108optionsmodel.cpp109optionsmodel.h110peertablemodel.cpp111peertablemodel.h112peertablesortproxy.cpp113peertablesortproxy.h114platformstyle.cpp115platformstyle.h116qvalidatedlineedit.cpp117qvalidatedlineedit.h118qvaluecombobox.cpp119qvaluecombobox.h120rpcconsole.cpp121rpcconsole.h122splashscreen.cpp123splashscreen.h124trafficgraphwidget.cpp125trafficgraphwidget.h126utilitydialog.cpp127utilitydialog.h128$<$<PLATFORM_ID:Windows>:winshutdownmonitor.cpp>129$<$<PLATFORM_ID:Windows>:winshutdownmonitor.h>130${BITCOIN_QRC}131${BITCOIN_LOCALE_QRC}132)133target_compile_definitions(bitcoinqt134PUBLIC135QT_NO_KEYWORDS136QT_USE_QSTRINGBUILDER137)138target_include_directories(bitcoinqt139PUBLIC140$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>141)142set_property(SOURCE macnotificationhandler.mm143# Ignore warnings "'NSUserNotificationCenter' is deprecated: first deprecated in macOS 11.0".144APPEND PROPERTY COMPILE_OPTIONS -Wno-deprecated-declarations145)146target_link_libraries(bitcoinqt147PUBLIC148Qt6::Widgets149PRIVATE150core_interface151bitcoin_cli152leveldb153Boost::headers154$<TARGET_NAME_IF_EXISTS:QRencode::QRencode>155$<$<PLATFORM_ID:Darwin>:-framework\ AppKit>156$<$<CXX_COMPILER_ID:MSVC>:shlwapi>157)159if(ENABLE_WALLET)160target_sources(bitcoinqt161PRIVATE162addressbookpage.cpp163addressbookpage.h164addresstablemodel.cpp165addresstablemodel.h166askpassphrasedialog.cpp167askpassphrasedialog.h168coincontroldialog.cpp169coincontroldialog.h170coincontroltreewidget.cpp171coincontroltreewidget.h172createwalletdialog.cpp173createwalletdialog.h174editaddressdialog.cpp175editaddressdialog.h176openuridialog.cpp177openuridialog.h178overviewpage.cpp179overviewpage.h180paymentserver.cpp181paymentserver.h182psbtoperationsdialog.cpp183psbtoperationsdialog.h184qrimagewidget.cpp185qrimagewidget.h186receivecoinsdialog.cpp187receivecoinsdialog.h188receiverequestdialog.cpp189receiverequestdialog.h190recentrequeststablemodel.cpp191recentrequeststablemodel.h192sendcoinsdialog.cpp193sendcoinsdialog.h194sendcoinsentry.cpp195sendcoinsentry.h196signverifymessagedialog.cpp197signverifymessagedialog.h198transactiondesc.cpp199transactiondesc.h200transactiondescdialog.cpp201transactiondescdialog.h202transactionfilterproxy.cpp203transactionfilterproxy.h204transactionoverviewwidget.cpp205transactionoverviewwidget.h206transactionrecord.cpp207transactionrecord.h208transactiontablemodel.cpp209transactiontablemodel.h210transactionview.cpp211transactionview.h212walletcontroller.cpp213walletcontroller.h214walletframe.cpp215walletframe.h216walletmodel.cpp217walletmodel.h218walletmodeltransaction.cpp219walletmodeltransaction.h220walletview.cpp221walletview.h222)223target_link_libraries(bitcoinqt224PRIVATE225bitcoin_wallet226Qt6::Network227)228endif()230if(WITH_DBUS)231target_link_libraries(bitcoinqt PRIVATE Qt6::DBus)232endif()234if(qt_lib_type STREQUAL "STATIC_LIBRARY")235# We want to define static plugins to link ourselves, thus preventing236# automatic linking against a "sane" set of default static plugins.237qt6_import_plugins(bitcoinqt238EXCLUDE_BY_TYPE239accessiblebridge240platforms241platforms_darwin242xcbglintegrations243platformthemes244platforminputcontexts245generic246iconengines247imageformats248egldeviceintegrations249styles250networkaccess
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.