mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-30 14:00:54 +02:00
Merge bitcoin/bitcoin#31844: cmake: add a component for each binary
9b033bebb1
cmake: rename Kernel component to bitcoinkernel for consistency (Cory Fields)2e0c92558e
cmake: add and use install_binary_component (Cory Fields)0264c5d86c
cmake: use per-target components for bitcoin-qt and bitcoin-gui (Cory Fields)fb0546b1c5
ci: don't try to install for a fuzz build (Cory Fields) Pull request description: This makes it possible to build/install only the desired binaries regardless of the configuration. For consistency, the component names match the binary names. `Kernel` and `GUI` have been renamed. Additionally it fixes #31762 by installing only the manpages for the configured targets (and includes them in the component installs for each). Also fixes #31745. Alternative to #31765 which is (imo) more correct/thorough. Can be tested using (for ex): ```bash $ cmake -B build $ cmake --build build -t bitcoind -t bitcoin-cli $ cmake --install build --component bitcoind $ cmake --install build --component bitcoin-cli ``` ACKs for top commit: hebasto: ACK9b033bebb1
. TheCharlatan: Re-ACK9b033bebb1
stickies-v: re-ACK9b033bebb1
Tree-SHA512: fd4818e76f190dbeafbf0c246b466f829771902c9d6d7111ed917093b811c8a5536a4a45e20708f73e7f581d6cb77c8e61cfa69e065788dcf0886792f553a355
This commit is contained in:
26
cmake/module/InstallBinaryComponent.cmake
Normal file
26
cmake/module/InstallBinaryComponent.cmake
Normal file
@@ -0,0 +1,26 @@
|
||||
# Copyright (c) 2025-present The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or https://opensource.org/license/mit/.
|
||||
|
||||
include_guard(GLOBAL)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
function(install_binary_component component)
|
||||
cmake_parse_arguments(PARSE_ARGV 1
|
||||
IC # prefix
|
||||
"HAS_MANPAGE" # options
|
||||
"" # one_value_keywords
|
||||
"" # multi_value_keywords
|
||||
)
|
||||
set(target_name ${component})
|
||||
install(TARGETS ${target_name}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
COMPONENT ${component}
|
||||
)
|
||||
if(INSTALL_MAN AND IC_HAS_MANPAGE)
|
||||
install(FILES ${PROJECT_SOURCE_DIR}/doc/man/${target_name}.1
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
|
||||
COMPONENT ${component}
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
@@ -84,7 +84,7 @@ function(add_macos_deploy_target)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt
|
||||
COMMAND ${CMAKE_COMMAND} --install ${PROJECT_BINARY_DIR} --config $<CONFIG> --component GUI --prefix ${macos_app}/Contents/MacOS --strip
|
||||
COMMAND ${CMAKE_COMMAND} --install ${PROJECT_BINARY_DIR} --config $<CONFIG> --component bitcoin-qt --prefix ${macos_app}/Contents/MacOS --strip
|
||||
COMMAND ${CMAKE_COMMAND} -E rename ${macos_app}/Contents/MacOS/bin/$<TARGET_FILE_NAME:bitcoin-qt> ${macos_app}/Contents/MacOS/Bitcoin-Qt
|
||||
COMMAND ${CMAKE_COMMAND} -E rm -rf ${macos_app}/Contents/MacOS/bin
|
||||
VERBATIM
|
||||
|
Reference in New Issue
Block a user