2
2
# Distributed under the MIT software license, see the accompanying
3
3
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
4
5
+ include (GNUInstallDirs)
6
+
5
7
configure_file (${CMAKE_SOURCE_DIR} /cmake/bitcoin-config.h.in config/bitcoin-config.h @ONLY)
6
8
add_compile_definitions (HAVE_CONFIG_H)
7
9
include_directories (${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} )
@@ -101,6 +103,7 @@ target_link_libraries(bitcoin_common
101
103
)
102
104
103
105
106
+ set (installable_targets)
104
107
if (ENABLE_WALLET)
105
108
add_subdirectory (wallet)
106
109
@@ -117,6 +120,7 @@ if(ENABLE_WALLET)
117
120
bitcoin_util
118
121
Boost::headers
119
122
)
123
+ list (APPEND installable_targets bitcoin-wallet)
120
124
endif ()
121
125
endif ()
122
126
@@ -246,6 +250,7 @@ if(BUILD_DAEMON)
246
250
core
247
251
bitcoin_node
248
252
)
253
+ list (APPEND installable_targets bitcoind)
249
254
endif ()
250
255
251
256
@@ -270,6 +275,7 @@ if(BUILD_CLI)
270
275
bitcoin_util
271
276
libevent::libevent
272
277
)
278
+ list (APPEND installable_targets bitcoin-cli)
273
279
endif ()
274
280
275
281
@@ -281,6 +287,7 @@ if(BUILD_TX)
281
287
bitcoin_util
282
288
univalue
283
289
)
290
+ list (APPEND installable_targets bitcoin-tx)
284
291
endif ()
285
292
286
293
@@ -291,6 +298,7 @@ if(BUILD_UTIL)
291
298
bitcoin_common
292
299
bitcoin_util
293
300
)
301
+ list (APPEND installable_targets bitcoin-util)
294
302
endif ()
295
303
296
304
@@ -302,3 +310,17 @@ endif()
302
310
if (BUILD_TESTS)
303
311
add_subdirectory (test )
304
312
endif ()
313
+
314
+
315
+ install (TARGETS ${installable_targets}
316
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
317
+ )
318
+ unset (installable_targets)
319
+
320
+ if (INSTALL_MAN)
321
+ # TODO: these stubs are no longer needed. man pages should be generated at install time.
322
+ install (DIRECTORY ../doc /man/
323
+ DESTINATION ${CMAKE_INSTALL_MANDIR} /man1
324
+ FILES_MATCHING PATTERN *.1
325
+ )
326
+ endif ()
0 commit comments