Inside Bitcoin
Opening the selected file…
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/.5include_guard(GLOBAL)7function(setup_split_debug_script)8if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")9set(OBJCOPY ${CMAKE_OBJCOPY})10set(STRIP ${CMAKE_STRIP})11configure_file(12contrib/devtools/split-debug.sh.in split-debug.sh13FILE_PERMISSIONS OWNER_READ OWNER_EXECUTE14GROUP_READ GROUP_EXECUTE15WORLD_READ16@ONLY17)18endif()19endfunction()21function(add_windows_deploy_target)22configure_file(${PROJECT_SOURCE_DIR}/cmake/script/GenerateWindowsInstaller.cmake.in ${PROJECT_BINARY_DIR}/GenerateWindowsInstaller.cmake USE_SOURCE_PERMISSIONS @ONLY)23if(MINGW AND TARGET bitcoin AND TARGET bitcoin-qt AND TARGET bitcoind AND TARGET bitcoin-cli AND TARGET bitcoin-tx AND TARGET bitcoin-wallet AND TARGET bitcoin-util AND TARGET test_bitcoin)24add_custom_command(25OUTPUT ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.exe26WORKING_DIRECTORY ${PROJECT_BINARY_DIR}27COMMAND ${CMAKE_COMMAND} -E make_directory release28COMMAND ${CMAKE_STRIP} $<TARGET_FILE:bitcoin> -o release/$<TARGET_FILE_NAME:bitcoin>29COMMAND ${CMAKE_STRIP} $<TARGET_FILE:bitcoin-qt> -o release/$<TARGET_FILE_NAME:bitcoin-qt>30COMMAND ${CMAKE_STRIP} $<TARGET_FILE:bitcoind> -o release/$<TARGET_FILE_NAME:bitcoind>31COMMAND ${CMAKE_STRIP} $<TARGET_FILE:bitcoin-cli> -o release/$<TARGET_FILE_NAME:bitcoin-cli>32COMMAND ${CMAKE_STRIP} $<TARGET_FILE:bitcoin-tx> -o release/$<TARGET_FILE_NAME:bitcoin-tx>33COMMAND ${CMAKE_STRIP} $<TARGET_FILE:bitcoin-wallet> -o release/$<TARGET_FILE_NAME:bitcoin-wallet>34COMMAND ${CMAKE_STRIP} $<TARGET_FILE:bitcoin-util> -o release/$<TARGET_FILE_NAME:bitcoin-util>35COMMAND ${CMAKE_STRIP} $<TARGET_FILE:test_bitcoin> -o release/$<TARGET_FILE_NAME:test_bitcoin>36COMMAND ${CMAKE_COMMAND} -D BIN_DIR=release -D LIBEXEC_DIR=release -P GenerateWindowsInstaller.cmake37)38add_custom_target(deploy DEPENDS ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.exe)39endif()40endfunction()42function(add_macos_deploy_target)43if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND TARGET bitcoin-qt)44set(macos_app "Bitcoin-Qt.app")45# Populate Contents subdirectory.46configure_file(${PROJECT_SOURCE_DIR}/share/qt/Info.plist.in ${macos_app}/Contents/Info.plist NO_SOURCE_PERMISSIONS)47file(CONFIGURE OUTPUT ${macos_app}/Contents/PkgInfo CONTENT "APPL????")48# Populate Contents/Resources subdirectory.49file(CONFIGURE OUTPUT ${macos_app}/Contents/Resources/empty.lproj CONTENT "")50configure_file(${PROJECT_SOURCE_DIR}/src/qt/res/icons/bitcoin.icns ${macos_app}/Contents/Resources/bitcoin.icns NO_SOURCE_PERMISSIONS COPYONLY)51file(CONFIGURE OUTPUT ${macos_app}/Contents/Resources/Base.lproj/InfoPlist.strings52CONTENT "{ CFBundleDisplayName = \"@CLIENT_NAME@\"; CFBundleName = \"@CLIENT_NAME@\"; }"53)55add_custom_command(56OUTPUT ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt57COMMAND ${CMAKE_COMMAND} --install ${PROJECT_BINARY_DIR} --config $<CONFIG> --component bitcoin-qt --prefix ${macos_app}/Contents/MacOS --strip58COMMAND ${CMAKE_COMMAND} -E rename ${macos_app}/Contents/MacOS/bin/$<TARGET_FILE_NAME:bitcoin-qt> ${macos_app}/Contents/MacOS/Bitcoin-Qt59COMMAND ${CMAKE_COMMAND} -E rm -rf ${macos_app}/Contents/MacOS/bin60COMMAND ${CMAKE_COMMAND} -E rm -rf ${macos_app}/Contents/MacOS/share61VERBATIM62)64set(macos_zip "bitcoin-macos-app")65if(CMAKE_HOST_APPLE)66add_custom_command(67OUTPUT ${PROJECT_BINARY_DIR}/${macos_zip}.zip68COMMAND Python3::Interpreter ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} -translations-dir=${QT_TRANSLATIONS_DIR} -zip=${macos_zip}69DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt70VERBATIM71)72add_custom_target(deploydir73DEPENDS ${PROJECT_BINARY_DIR}/${macos_zip}.zip74)75add_custom_target(deploy76DEPENDS ${PROJECT_BINARY_DIR}/${macos_zip}.zip77)78else()79add_custom_command(80OUTPUT ${PROJECT_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Bitcoin-Qt81COMMAND ${CMAKE_COMMAND} -E env OBJDUMP=${CMAKE_OBJDUMP} $<TARGET_FILE:Python3::Interpreter> ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} -translations-dir=${QT_TRANSLATIONS_DIR}82DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt83VERBATIM84)85add_custom_target(deploydir86DEPENDS ${PROJECT_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Bitcoin-Qt87)89find_program(ZIP_EXECUTABLE zip)90if(NOT ZIP_EXECUTABLE)91add_custom_target(deploy92COMMAND ${CMAKE_COMMAND} -E echo "Error: ZIP not found"93)94else()95add_custom_command(96OUTPUT ${PROJECT_BINARY_DIR}/dist/${macos_zip}.zip97WORKING_DIRECTORY dist98COMMAND ${PROJECT_SOURCE_DIR}/cmake/script/macos_zip.sh ${ZIP_EXECUTABLE} ${macos_zip}.zip99VERBATIM100)101add_custom_target(deploy102DEPENDS ${PROJECT_BINARY_DIR}/dist/${macos_zip}.zip103)104endif()105endif()106add_dependencies(deploydir bitcoin-qt)107add_dependencies(deploy deploydir)108endif()109endfunction()
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.