Skip to content

Commit

Permalink
cmake: Install man pages for configured targets only
Browse files Browse the repository at this point in the history
Co-authored-by: stickies-v <[email protected]>
  • Loading branch information
hebasto and stickies-v committed Feb 7, 2025
1 parent 809d7e7 commit c783833
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@ target_link_libraries(bitcoin_common


set(installable_targets)
macro(install_manpage target)
if(INSTALL_MAN)
install(FILES ${PROJECT_SOURCE_DIR}/doc/man/${target}.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
${ARGN}
)
endif()
endmacro()

if(ENABLE_WALLET)
add_subdirectory(wallet)

Expand All @@ -190,6 +199,7 @@ if(ENABLE_WALLET)
Boost::headers
)
list(APPEND installable_targets bitcoin-wallet)
install_manpage(bitcoin-wallet)
endif()
endif()

Expand Down Expand Up @@ -319,6 +329,7 @@ if(BUILD_DAEMON)
$<TARGET_NAME_IF_EXISTS:bitcoin_wallet>
)
list(APPEND installable_targets bitcoind)
install_manpage(bitcoind)
endif()
if(WITH_MULTIPROCESS)
add_executable(bitcoin-node
Expand Down Expand Up @@ -375,6 +386,7 @@ if(BUILD_CLI)
libevent::extra
)
list(APPEND installable_targets bitcoin-cli)
install_manpage(bitcoin-cli)
endif()


Expand All @@ -388,6 +400,7 @@ if(BUILD_TX)
univalue
)
list(APPEND installable_targets bitcoin-tx)
install_manpage(bitcoin-tx)
endif()


Expand All @@ -400,6 +413,7 @@ if(BUILD_UTIL)
bitcoin_util
)
list(APPEND installable_targets bitcoin-util)
install_manpage(bitcoin-util)
endif()


Expand Down Expand Up @@ -451,11 +465,3 @@ 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()
2 changes: 2 additions & 0 deletions src/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ if(WIN32)
set_target_properties(bitcoin-qt PROPERTIES WIN32_EXECUTABLE TRUE)
endif()

install_manpage(bitcoin-qt COMPONENT GUI)

if(WITH_MULTIPROCESS)
add_executable(bitcoin-gui
main.cpp
Expand Down

0 comments on commit c783833

Please sign in to comment.