-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
87 lines (71 loc) · 2.21 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
cmake_minimum_required(VERSION 3.17)
project(nanochain)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
### ZEROMQ
## use the hint from about to find the location of libzmq
## load in pkg-config support
find_package(PkgConfig)
## use pkg-config to get hints for 0mq locations
pkg_check_modules(PC_ZeroMQ QUIET zmq)
find_library(ZeroMQ_LIBRARY
NAMES zmq
PATHS ${PC_ZeroMQ_LIBRARY_DIRS}
)
#######
# Logging
add_subdirectory(vendor/spdlog)
find_package(spdlog)
include_directories(/usr/local/Cellar/zeromq/4.3.4/include/)
include_directories(vendor/cryptopp/
vendor/json/
vendor/cppzmq/
src)
# Build Cryptopp
add_subdirectory(vendor/cryptopp)
find_library(vendor/cryptopp libcryptopp)
set_target_properties(cryptopp-static PROPERTIES EXCLUDE_FROM_ALL True)
# Common library for all core and networking components
add_library(nanochain_core
src/core/hashing.cpp
src/core/sign.cpp
src/core/transaction.cpp
src/core/block.cpp
src/core/serializing.cpp
src/core/netmessaging.cpp
src/core/netclient.cpp
src/core/peer.h
)
target_link_libraries(nanochain_core cryptopp-static)
# Node program
add_executable(node
src/node/main.cpp
src/node/node.cpp
src/node/block_pool.cpp
src/node/listen_server.cpp
src/node/transaction_pool.cpp
src/node/nodeconfig.cpp
)
# Miner program
add_executable(miner
src/miner/main.cpp
src/miner/miner.cpp
src/miner/mempool.cpp
)
# Miner program
add_executable(wallet
src/wallet/main.cpp
src/wallet/wallet.cpp
src/wallet/config.cpp
)
target_link_libraries(node nanochain_core)
target_link_libraries(node ${ZeroMQ_LIBRARY})
target_link_libraries(node spdlog)
target_link_libraries(miner nanochain_core)
target_link_libraries(miner ${ZeroMQ_LIBRARY})
target_link_libraries(miner spdlog)
target_link_libraries(wallet nanochain_core)
target_link_libraries(wallet ${ZeroMQ_LIBRARY})
target_link_libraries(wallet spdlog)