forked from Bitcoin-ABC/bitcoin-abc
-
Notifications
You must be signed in to change notification settings - Fork 28
/
CMakeLists.txt
151 lines (147 loc) · 3.95 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# Copyright (c) 2019-2021 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
configure_file(Doxyfile.cmake.in Doxyfile ESCAPE_QUOTES)
option(DOC_ONLINE "Adapt Markdown/HTML documentation for online publication" OFF)
configure_file(
../cmake/utils/gen-doc-md.sh.in
gen-doc-md.sh
@ONLY
)
add_custom_target(doc-md
COMMENT "Building Markdown documentation..."
DEPENDS bitcoind
DEPENDS bitcoin-qt
DEPENDS bitcoin-cli
DEPENDS bitcoin-tx
DEPENDS bitcoin-seeder
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/gen-doc-md.sh"
COMMAND "${CMAKE_CURRENT_BINARY_DIR}/gen-doc-md.sh"
)
add_custom_target(doc-html
COMMENT "Building HTML documentation..."
DEPENDS doc-md
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMAND mkdocs build
)
option(ENABLE_MAN "Enable manpages" ON)
if(ENABLE_MAN AND BUILD_BITCOIN_DAEMON)
configure_file(
../cmake/utils/gen-doc-man-footer.sh.in
man/gen-doc-man-footer.sh
@ONLY
)
add_custom_command(
OUTPUT man/footer.h2m
DEPENDS bitcoind
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/man/gen-doc-man-footer.sh"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/man"
COMMAND ./gen-doc-man-footer.sh
)
configure_file(
../cmake/utils/gen-doc-man.sh.in
man/gen-doc-man.sh
@ONLY
)
include(GNUInstallDirs)
set(MAN_DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
add_custom_command(
OUTPUT man/bitcoind.1
DEPENDS bitcoind
DEPENDS man/footer.h2m
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/man/gen-doc-man.sh"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/man"
COMMAND ./gen-doc-man.sh bitcoind
)
add_custom_target(doc-man-bitcoind
ALL
DEPENDS man/bitcoind.1
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/man/bitcoind.1"
DESTINATION "${MAN_DESTINATION}"
COMPONENT bitcoind
)
if(BUILD_BITCOIN_QT)
add_custom_command(
OUTPUT man/bitcoin-qt.1
DEPENDS bitcoin-qt
DEPENDS man/footer.h2m
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/man/gen-doc-man.sh"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/man"
COMMAND ./gen-doc-man.sh qt/bitcoin-qt
)
add_custom_target(doc-man-bitcoin-qt
ALL
DEPENDS man/bitcoin-qt.1
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/man/bitcoin-qt.1"
DESTINATION "${MAN_DESTINATION}"
COMPONENT bitcoin-qt
)
endif()
if(BUILD_BITCOIN_CLI)
add_custom_command(
OUTPUT man/bitcoin-cli.1
DEPENDS bitcoin-cli
DEPENDS man/footer.h2m
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/man/gen-doc-man.sh"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/man"
COMMAND ./gen-doc-man.sh bitcoin-cli
)
add_custom_target(doc-man-bitcoin-cli
ALL
DEPENDS man/bitcoin-cli.1
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/man/bitcoin-cli.1"
DESTINATION "${MAN_DESTINATION}"
COMPONENT bitcoind
)
endif()
if(BUILD_BITCOIN_TX)
add_custom_command(
OUTPUT man/bitcoin-tx.1
DEPENDS bitcoin-tx
DEPENDS man/footer.h2m
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/man/gen-doc-man.sh"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/man"
COMMAND ./gen-doc-man.sh bitcoin-tx
)
add_custom_target(doc-man-bitcoin-tx
ALL
DEPENDS man/bitcoin-tx.1
)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/man/bitcoin-tx.1"
DESTINATION "${MAN_DESTINATION}"
COMPONENT bitcoind
)
endif()
if(BUILD_BITCOIN_SEEDER)
add_custom_command(
OUTPUT man/bitcoin-seeder.1
DEPENDS bitcoin-seeder
DEPENDS man/footer.h2m
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/man/gen-doc-man.sh"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/man"
COMMAND ./gen-doc-man.sh seeder/bitcoin-seeder
)
add_custom_target(doc-man-bitcoin-seeder
ALL
DEPENDS man/bitcoin-seeder.1)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/man/bitcoin-seeder.1"
DESTINATION "${MAN_DESTINATION}"
COMPONENT bitcoin-seeder
)
endif()
add_custom_target(doc-man
DEPENDS doc-man-bitcoind
DEPENDS doc-man-bitcoin-qt
DEPENDS doc-man-bitcoin-cli
DEPENDS doc-man-bitcoin-tx
DEPENDS doc-man-bitcoin-seeder
)
endif()