forked from Xenland/BitShares
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
225 lines (175 loc) · 7.06 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
project( bitshares )
cmake_minimum_required( VERSION 2.8.10 )
#set( CMAKE_AUTOMOC ON )
set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" "${CMAKE_SOURCE_DIR}/fc/CMakeModules" ${CMAKE_MODULE_PATH} )
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/fc/GitVersionGen/")
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA2)
FIND_PACKAGE( OpenSSL )
SET( ALL_OPENSSL_LIBRARIES
${OPENSSL_LIBRARIES}
${SSL_EAY_RELEASE}
${LIB_EAY_RELEASE}
)
# Set the Berkeley DB version you use
IF (WIN32)
SET(DB_VERSION 60)
SET(BDB_STATIC_LIBS 1)
ENDIF()
FIND_PACKAGE( BerkeleyDB )
IF (NOT ${BerkeleyDB_FOUND})
MESSAGE (SEND_ERROR "Missing required BerkeleyDB package")
ENDIF()
include_directories(${BDB_INCLUDE_DIR})
#include( VersionMacros )
#include( SetupTargetMacros )
if( UNIX )
if( NOT APPLE )
set(rt_library rt )
set(pthread_library pthread)
endif()
endif()
IF( WIN32 )
MESSAGE(status "Compiling on WIN32")
ADD_DEFINITIONS( -DWIN32 )
ADD_DEFINITIONS( -DNOMINMAX )
ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
ADD_DEFINITIONS( -D_WIN32_WINNT=0x0501 )
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
ADD_DEFINITIONS( -DLEVELDB_PLATFORM_WINDOWS )
# Activate C++ exception handling
IF (NOT CMAKE_CXX_FLAGS MATCHES "/EHsc")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
ENDIF()
#openssl
#set( OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/vendor/openssl" )
#set( LIB_EAY_RELEASE "${CMAKE_CURRENT_SOURCE_DIR}/vendor/openssl/out32dll/libeay32.lib" )
#set( SSL_EAY_RELEASE "${CMAKE_CURRENT_SOURCE_DIR}/vendor/openssl/out32dll/ssleay32.lib" )
#include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/vendor/openssl/include" )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/leveldb-win/include )
add_subdirectory( vendor/leveldb-win )
ELSE(WIN32)
MESSAGE(status "Compiling on UNIX")
SET(Boost_USE_STATIC_LIBS ON)
FIND_PACKAGE(Boost 1.55 REQUIRED COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context coroutine)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/leveldb-1.12.0/include )
add_subdirectory( vendor/leveldb-1.12.0 )
IF( APPLE )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -stdlib=libc++" )
SET(CMAKE_CC_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -stdlib=libc++" )
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall" )
ELSE( NOT APPLE )
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -Wno-unused-local-typedefs -fmax-errors=3 -msse4.2" )
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wno-unused-local-typedefs -fmax-errors=3 -msse4.2" )
ENDIF( APPLE )
FIND_PACKAGE( ZLIB REQUIRED )
include_directories( ${ZLIB_INCLUDE_DIRS} )
IF( NOT APPLE )
SET( pthread pthread )
ENDIF( NOT APPLE )
ENDIF(WIN32)
set( BOOST_LIBRARIES ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_CHRONO_LIBRARY} ${ALL_OPENSSL_LIBRARIES} ${Boost_COROUTINE_LIBRARY} ${Boost_CONTEXT_LIBRARY} ${pthread} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/fc/include )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/include )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/SFMT-src-1.4 )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/vendor/miniupnp )
include_directories( ${Boost_INCLUDE_DIR} )
#need this for boost::process (not an official boost library yet)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/fc/vendor/boost_1.51/include )
include_directories( ${BDB_CXX_INCLUDE_DIR} )
#set( BOOST_LIBRARIES {BOOST_LIBRARIES} pthread )
#link_directories( ${Boost_LIBRARY_DIRS} )
add_subdirectory( fc )
add_subdirectory( vendor/miniupnp/miniupnpc )
#IF( APPLE )
#FIND_LIBRARY (APPKIT_LIBRARY AppKit)
#add_subdirectory( vendor/qtmacextras )
#ENDIF( APPLE )
#add_subdirectory( vendor/libzerocoin )
set( sources
src/momentum.cpp
src/network/stcp_socket.cpp
src/network/connection.cpp
src/network/server.cpp
src/network/get_public_ip.cpp
src/network/upnp.cpp
src/network/ipecho.cpp
src/peer/peer_channel.cpp
src/peer/peer_messages.cpp
src/bitname/bitname_block.cpp
src/bitname/bitname_hash.cpp
src/bitname/bitname_miner.cpp
src/bitname/bitname_db.cpp
src/bitname/bitname_fork_db.cpp
src/bitname/bitname_messages.cpp
src/bitname/bitname_channel.cpp
src/bitname/bitname_client.cpp
src/bitname/bitname_record.cpp
src/bitchat/bitchat_private_message.cpp
src/bitchat/bitchat_messages.cpp
src/bitchat/bitchat_channel.cpp
src/bitchat/bitchat_client.cpp
src/bitchat/bitchat_message_cache.cpp
src/bitchat/bitchat_message_db.cpp
src/mail/mail_connection.cpp
src/mail/mail_server.cpp
src/mail/stcp_socket.cpp
src/addressbook/addressbook.cpp
src/blockchain/asset.cpp
src/blockchain/block.cpp
src/blockchain/transaction.cpp
src/blockchain/trx_validation_state.cpp
src/blockchain/blockchain_outputs.cpp
src/blockchain/blockchain_db.cpp
src/blockchain/blockchain_market_db.cpp
src/blockchain/blockchain_printer.cpp
src/blockchain/blockchain_messages.cpp
src/blockchain/blockchain_channel.cpp
src/blockchain/blockchain_client.cpp
src/blockchain/blockchain_time_keeper.cpp
src/blockchain/blockchain_wallet.cpp
src/rpc/rpc_server.cpp
# src/unity/node.cpp
# src/unity/server.cpp
# src/unity/connection.cpp
src/application.cpp
src/difficulty.cpp
src/profile.cpp
src/extended_address.cpp
src/small_hash.cpp
src/merkle_tree.cpp
src/address.cpp
src/pts_address.cpp
src/wallet.cpp
src/keychain.cpp
src/wallet_cache.cpp
src/bitcoin_wallet.cpp
src/multibit_wallet.cpp
src/multibit.pb.cc
vendor/SFMT-src-1.4/SFMT.c
src/proof_of_work.cpp )
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/GitSHA2.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/GitSHA2.cpp" @ONLY)
list(APPEND sources "${CMAKE_CURRENT_BINARY_DIR}/GitSHA2.cpp" GitSHA2.h)
add_library( bshare ${sources} )
target_link_libraries(bshare ${BDB_LIBRARIES} )
IF( UNIX )
target_link_libraries(bshare ${ZLIB_LIBRARIES} )
ENDIF()
#add_subdirectory( sancho )
#add_subdirectory( server )
#add_executable( wallet_test tests/wallet_test.cpp )
#target_link_libraries( wallet_test bshare fc ${BOOST_LIBRARIES})
#setup_library( bshare SOURCES ${sources} LIBRARY_TYPE STATIC )
#add_executable( unit_tests tests/unit_tests.cpp )
#target_link_libraries( unit_tests bshare fc ${BOOST_LIBRARIES} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} )
#add_executable( bitshares src/main.cpp )
#target_link_libraries( bitshares bshare fc ${BOOST_LIBRARIES})
#add_executable( bitchatc bitchat/main.cpp )
#target_link_libraries( bitchatc upnpc-static bshare fc ${BOOST_LIBRARIES} upnpc-static )
#add_executable( bitshared bitshared.cpp )
#target_link_libraries( bitshared bshare fc ${BOOST_LIBRARIES} )
#add_subdirectory( cli_client )
add_subdirectory( bts_wallet )
add_subdirectory( tests )
add_subdirectory( founder_reg_server )
add_subdirectory( mail_server )