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
@@ -247,6 +251,7 @@ if(BUILD_DAEMON)
247
251
core
248
252
bitcoin_node
249
253
)
254
+ list (APPEND installable_targets bitcoind)
250
255
endif ()
251
256
252
257
@@ -271,6 +276,7 @@ if(BUILD_CLI)
271
276
bitcoin_util
272
277
libevent::libevent
273
278
)
279
+ list (APPEND installable_targets bitcoin-cli)
274
280
endif ()
275
281
276
282
@@ -282,6 +288,7 @@ if(BUILD_TX)
282
288
bitcoin_util
283
289
univalue
284
290
)
291
+ list (APPEND installable_targets bitcoin-tx)
285
292
endif ()
286
293
287
294
@@ -292,6 +299,7 @@ if(BUILD_UTIL)
292
299
bitcoin_common
293
300
bitcoin_util
294
301
)
302
+ list (APPEND installable_targets bitcoin-util)
295
303
endif ()
296
304
297
305
@@ -303,3 +311,17 @@ endif()
303
311
if (BUILD_TESTS)
304
312
add_subdirectory (test )
305
313
endif ()
314
+
315
+
316
+ install (TARGETS ${installable_targets}
317
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
318
+ )
319
+ unset (installable_targets)
320
+
321
+ if (INSTALL_MAN)
322
+ # TODO: these stubs are no longer needed. man pages should be generated at install time.
323
+ install (DIRECTORY ../doc /man/
324
+ DESTINATION ${CMAKE_INSTALL_MANDIR} /man1
325
+ FILES_MATCHING PATTERN *.1
326
+ )
327
+ endif ()
0 commit comments