mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-13 11:35:20 +01:00
cmake: Implement install
build target
This commit is contained in:
parent
84ac35cfd4
commit
973a3b0c5d
6 changed files with 46 additions and 0 deletions
|
@ -187,6 +187,8 @@ option(BUILD_BENCH "Build bench_bitcoin executable." OFF)
|
|||
option(BUILD_FUZZ_BINARY "Build fuzz binary." OFF)
|
||||
cmake_dependent_option(BUILD_FOR_FUZZING "Build for fuzzing. Enabling this will disable all other targets and override BUILD_FUZZ_BINARY." OFF "NOT MSVC" OFF)
|
||||
|
||||
option(INSTALL_MAN "Install man pages." ON)
|
||||
|
||||
set(configure_warnings)
|
||||
|
||||
include(CheckPIESupported)
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or https://opensource.org/license/mit/.
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
configure_file(${PROJECT_SOURCE_DIR}/cmake/bitcoin-config.h.in config/bitcoin-config.h @ONLY)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
|
@ -160,6 +162,7 @@ target_link_libraries(bitcoin_common
|
|||
)
|
||||
|
||||
|
||||
set(installable_targets)
|
||||
if(ENABLE_WALLET)
|
||||
add_subdirectory(wallet)
|
||||
|
||||
|
@ -176,6 +179,7 @@ if(ENABLE_WALLET)
|
|||
bitcoin_util
|
||||
Boost::headers
|
||||
)
|
||||
list(APPEND installable_targets bitcoin-wallet)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -304,6 +308,7 @@ if(BUILD_DAEMON)
|
|||
bitcoin_node
|
||||
$<TARGET_NAME_IF_EXISTS:bitcoin_wallet>
|
||||
)
|
||||
list(APPEND installable_targets bitcoind)
|
||||
endif()
|
||||
if(WITH_MULTIPROCESS)
|
||||
add_executable(bitcoin-node
|
||||
|
@ -316,6 +321,7 @@ if(WITH_MULTIPROCESS)
|
|||
bitcoin_ipc
|
||||
$<TARGET_NAME_IF_EXISTS:bitcoin_wallet>
|
||||
)
|
||||
list(APPEND installable_targets bitcoin-node)
|
||||
endif()
|
||||
|
||||
|
||||
|
@ -340,6 +346,7 @@ if(BUILD_CLI)
|
|||
bitcoin_util
|
||||
$<TARGET_NAME_IF_EXISTS:libevent::libevent>
|
||||
)
|
||||
list(APPEND installable_targets bitcoin-cli)
|
||||
endif()
|
||||
|
||||
|
||||
|
@ -351,6 +358,7 @@ if(BUILD_TX)
|
|||
bitcoin_util
|
||||
univalue
|
||||
)
|
||||
list(APPEND installable_targets bitcoin-tx)
|
||||
endif()
|
||||
|
||||
|
||||
|
@ -361,6 +369,7 @@ if(BUILD_UTIL)
|
|||
bitcoin_common
|
||||
bitcoin_util
|
||||
)
|
||||
list(APPEND installable_targets bitcoin-util)
|
||||
endif()
|
||||
|
||||
|
||||
|
@ -406,3 +415,17 @@ endif()
|
|||
if(BUILD_FUZZ_BINARY)
|
||||
add_subdirectory(test/fuzz)
|
||||
endif()
|
||||
|
||||
|
||||
install(TARGETS ${installable_targets}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
unset(installable_targets)
|
||||
|
||||
if(INSTALL_MAN)
|
||||
# TODO: these stubs are no longer needed. man pages should be generated at install time.
|
||||
install(DIRECTORY ../doc/man/
|
||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
|
||||
FILES_MATCHING PATTERN *.1
|
||||
)
|
||||
endif()
|
||||
|
|
|
@ -79,3 +79,7 @@ endif()
|
|||
add_test(NAME bench_sanity_check_high_priority
|
||||
COMMAND bench_bitcoin -sanity-check -priority-level=high
|
||||
)
|
||||
|
||||
install(TARGETS bench_bitcoin
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
|
|
|
@ -97,3 +97,10 @@ target_link_libraries(bitcoinkernel
|
|||
set_target_properties(bitcoinkernel PROPERTIES
|
||||
CXX_VISIBILITY_PRESET default
|
||||
)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS bitcoinkernel
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
|
|
|
@ -255,11 +255,17 @@ if(WITH_MULTIPROCESS)
|
|||
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()
|
||||
|
|
|
@ -217,3 +217,7 @@ function(add_all_test_targets)
|
|||
endfunction()
|
||||
|
||||
add_all_test_targets()
|
||||
|
||||
install(TARGETS test_bitcoin
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue