mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-31 08:04:02 +02:00
cmake: add and use install_binary_component
Add a separate component for each binary for fine-grained installation options. Also install the man pages for only for the targets enabled.
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()
|
Reference in New Issue
Block a user