-
Notifications
You must be signed in to change notification settings - Fork 35
/
CMakeLists.txt
377 lines (337 loc) · 15.1 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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
cmake_minimum_required(VERSION 2.8)
include(CryptoNoteWallet.cmake)
include(QREncode.cmake)
if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12" CACHE STRING "Minimum OS X deployment version")
endif(APPLE)
project(${CN_PROJECT_NAME})
execute_process(COMMAND git log -1 --pretty=format:%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_REVISION)
set(CRYPTONOTE_LIB cryptonote)
set(CMAKE_PREFIX_PATH "C:\\Qt\\5.11.0\\msvc2017_64\\lib\\cmake\\")
include_directories(${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
src
cryptonote/external
cryptonote/external/miniupnpc/include
cryptonote/include
cryptonote/src)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Charts)
set(Boost_NO_BOOST_CMAKE ON)
set(Boost_USE_STATIC_LIBS ON)
if(WIN32)
set(Boost_USE_STATIC_RUNTIME OFF)
else(WIN32)
set(Boost_USE_STATIC_RUNTIME ON)
endif(WIN32)
find_package(Boost 1.55 REQUIRED COMPONENTS date_time filesystem program_options regex serialization system thread chrono)
if ((${Boost_MAJOR_VERSION} EQUAL 1) AND (${Boost_MINOR_VERSION} EQUAL 54))
message(SEND_ERROR "Boost version 1.54 is unsupported, more details are available here http://goo.gl/RrCFmA")
endif ()
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
set(VERSION "")
configure_file("cryptonote/src/version.h.in" "version.h")
configure_file("src/CryptoNoteWalletConfig.h.in" "CryptoNoteWalletConfig.h")
add_definitions(-DVERSION=\"${CN_VERSION}\")
add_definitions(-DGIT_REVISION=\"${GIT_REVISION}\")
set(CMAKE_AUTOMOC ON)
set(CRYPTONOTE_SOURCES
cryptonote/external/miniupnpc/src/addr_is_reserved.c
cryptonote/external/miniupnpc/src/connecthostport.c
cryptonote/external/miniupnpc/src/igd_desc_parse.c
cryptonote/external/miniupnpc/src/minisoap.c
cryptonote/external/miniupnpc/src/minissdpc.c
cryptonote/external/miniupnpc/src/miniupnpc.c
cryptonote/external/miniupnpc/src/miniwget.c
cryptonote/external/miniupnpc/src/minixml.c
cryptonote/external/miniupnpc/src/portlistingparse.c
cryptonote/external/miniupnpc/src/receivedata.c
cryptonote/external/miniupnpc/src/upnpcommands.c
cryptonote/external/miniupnpc/src/upnpdev.c
cryptonote/external/miniupnpc/src/upnpreplyparse.c
cryptonote/src/Common/Base58.cpp
cryptonote/src/Common/Base64.cpp
cryptonote/src/Common/CommandLine.cpp
cryptonote/src/Common/Util.cpp
cryptonote/src/Common/StringTools.cpp
cryptonote/src/Common/JsonValue.cpp
cryptonote/src/Common/ConsoleTools.cpp
cryptonote/src/Common/MemoryInputStream.cpp
cryptonote/src/Common/PathTools.cpp
cryptonote/src/Common/DnsTools.cpp
cryptonote/src/Common/ScopeExit.cpp
cryptonote/src/Common/StdInputStream.cpp
cryptonote/src/Common/StdOutputStream.cpp
cryptonote/src/Common/StreamTools.cpp
cryptonote/src/Common/StringOutputStream.cpp
cryptonote/src/Common/StringView.cpp
cryptonote/src/Common/VectorOutputStream.cpp
cryptonote/src/crypto/chacha8.c
cryptonote/src/crypto/soft_aes.hpp
cryptonote/src/crypto/crypto-ops-data.c
cryptonote/src/crypto/crypto-ops.c
cryptonote/src/crypto/crypto.cpp
cryptonote/src/crypto/hash.c
cryptonote/src/crypto/keccak.c
cryptonote/src/crypto/random.c
cryptonote/src/crypto/tree-hash.c
cryptonote/src/crypto/cryptonight.cpp
cryptonote/src/crypto/pow_hash/arm8_neon.hpp
cryptonote/src/crypto/pow_hash/arm_vfp.hpp
cryptonote/src/crypto/pow_hash/aux_hash.c
cryptonote/src/crypto/pow_hash/aux_hash.h
cryptonote/src/crypto/pow_hash/cn_slow_hash_hard_arm.cpp
cryptonote/src/crypto/pow_hash/cn_slow_hash_hard_intel.cpp
cryptonote/src/crypto/pow_hash/cn_slow_hash.hpp
cryptonote/src/crypto/pow_hash/cn_slow_hash_intel_avx2.cpp
cryptonote/src/crypto/pow_hash/cn_slow_hash_soft.cpp
cryptonote/src/crypto/pow_hash/hw_detect.hpp
cryptonote/src/CryptoNoteCore/BlockchainIndices.cpp
cryptonote/src/CryptoNoteCore/BlockchainMessages.cpp
cryptonote/src/CryptoNoteCore/BlockIndex.cpp
cryptonote/src/CryptoNoteCore/CoreConfig.cpp
cryptonote/src/CryptoNoteCore/CryptoNoteBasic.cpp
cryptonote/src/CryptoNoteCore/CryptoNoteTools.cpp
cryptonote/src/CryptoNoteCore/Currency.cpp
cryptonote/src/CryptoNoteCore/DepositIndex.cpp
cryptonote/src/CryptoNoteCore/InvestmentIndex.cpp
cryptonote/src/CryptoNoteCore/MinerConfig.cpp
cryptonote/src/CryptoNoteCore/Transaction.cpp
cryptonote/src/CryptoNoteCore/Account.cpp
cryptonote/src/CryptoNoteCore/Blockchain.cpp
cryptonote/src/CryptoNoteCore/Checkpoints.cpp
cryptonote/src/CryptoNoteCore/CryptoNoteBasicImpl.cpp
cryptonote/src/CryptoNoteCore/Core.cpp
cryptonote/src/CryptoNoteCore/CryptoNoteFormatUtils.cpp
cryptonote/src/CryptoNoteCore/CryptoNoteSerialization.cpp
cryptonote/src/CryptoNoteCore/Difficulty.cpp
cryptonote/src/CryptoNoteCore/IBlock.cpp
cryptonote/src/CryptoNoteCore/Miner.cpp
cryptonote/src/CryptoNoteCore/TransactionExtra.cpp
cryptonote/src/CryptoNoteCore/TransactionPool.cpp
cryptonote/src/CryptoNoteCore/TransactionPrefixImpl.cpp
cryptonote/src/CryptoNoteCore/TransactionUtils.cpp
cryptonote/src/InProcessNode/InProcessNode.cpp
cryptonote/src/InProcessNode/InProcessNodeErrors.cpp
cryptonote/src/NodeRpcProxy/NodeErrors.cpp
cryptonote/src/NodeRpcProxy/NodeRpcProxy.cpp
cryptonote/src/P2p/NetNodeConfig.cpp
cryptonote/src/Serialization/BinaryInputStreamSerializer.cpp
cryptonote/src/Serialization/BinaryOutputStreamSerializer.cpp
cryptonote/src/Serialization/JsonInputValueSerializer.cpp
cryptonote/src/Serialization/JsonOutputStreamSerializer.cpp
cryptonote/src/Serialization/KVBinaryInputStreamSerializer.cpp
cryptonote/src/Serialization/KVBinaryOutputStreamSerializer.cpp
cryptonote/src/Serialization/SerializationOverloads.cpp
cryptonote/src/Transfers/BlockchainSynchronizer.cpp
cryptonote/src/Transfers/SynchronizationState.cpp
cryptonote/src/Transfers/TransfersConsumer.cpp
cryptonote/src/Transfers/TransfersContainer.cpp
cryptonote/src/Transfers/TransfersSubscription.cpp
cryptonote/src/Transfers/TransfersSynchronizer.cpp
cryptonote/src/Wallet/LegacyKeysImporter.cpp
cryptonote/src/Wallet/WalletAsyncContextCounter.cpp
cryptonote/src/Wallet/WalletErrors.cpp
cryptonote/src/Wallet/WalletGreen.cpp
cryptonote/src/Wallet/WalletSerializationV1.cpp
cryptonote/src/Wallet/WalletSerializationV2.cpp
cryptonote/src/Wallet/WalletUtils.cpp
cryptonote/src/WalletLegacy/KeysStorage.cpp
cryptonote/src/WalletLegacy/WalletLegacySerializer.cpp
cryptonote/src/WalletLegacy/WalletLegacySerialization.cpp
cryptonote/src/WalletLegacy/WalletUnconfirmedTransactions.cpp
cryptonote/src/WalletLegacy/WalletUserTransactionsCache.cpp
cryptonote/src/System/ContextGroup.cpp
cryptonote/src/System/Event.cpp
cryptonote/src/System/EventLock.cpp
cryptonote/src/System/InterruptedException.cpp
cryptonote/src/System/Ipv4Address.cpp
cryptonote/src/System/TcpStream.cpp
cryptonote/src/HTTP/HttpRequest.cpp
cryptonote/src/HTTP/HttpParser.cpp
cryptonote/src/HTTP/HttpParserErrorCodes.cpp
cryptonote/src/HTTP/HttpResponse.cpp
cryptonote/src/Rpc/HttpClient.cpp
cryptonote/src/Rpc/JsonRpc.cpp
cryptonote/src/P2p/NetNode.cpp
cryptonote/src/P2p/LevinProtocol.cpp
cryptonote/src/P2p/NetNodeConfig.cpp
cryptonote/src/P2p/PeerListManager.cpp
cryptonote/src/CryptoNoteProtocol/CryptoNoteProtocolHandler.cpp
cryptonote/src/Logging/ILogger.cpp
cryptonote/src/Logging/LoggerGroup.cpp
cryptonote/src/Logging/CommonLogger.cpp
cryptonote/src/Logging/LoggerManager.cpp
cryptonote/src/Logging/FileLogger.cpp
cryptonote/src/Logging/StreamLogger.cpp
cryptonote/src/Logging/ConsoleLogger.cpp
cryptonote/src/Logging/LoggerMessage.cpp
cryptonote/src/Logging/LoggerRef.cpp
cryptonote/src/BlockchainExplorer/BlockchainExplorer.cpp
cryptonote/src/BlockchainExplorer/BlockchainExplorerDataBuilder.cpp
cryptonote/src/BlockchainExplorer/BlockchainExplorerErrors.cpp
cryptonote/src/Mnemonics/Mnemonics.cpp
)
file(GLOB_RECURSE SOURCES src/*.cpp)
file(GLOB_RECURSE HEADERS src/*.h)
file(GLOB_RECURSE FORMS src/gui/ui/*.ui)
set(QRC src/resources.qrc)
qt5_wrap_ui(UIS ${FORMS})
qt5_add_resources(RCC ${QRC})
if("${ARCH}" STREQUAL "default")
set(ARCH_FLAG "")
else()
set(ARCH_FLAG "-march=x86-64")
endif()
include(cryptonote/arm.cmake)
if (WIN32)
if (NOT MSVC)
message(FATAL_ERROR "Only MSVC is supported on this platform")
endif ()
add_definitions(/D_CRT_SECURE_NO_WARNINGS /D_WIN32_WINNT=0x0600 /DMINIUPNP_STATICLIB)
include_directories(cryptonote/src/platform/msc)
set(PLATFORM_DIR Windows)
set(BUILD_PLATFORM WIN32)
set(BUILD_RESOURCES conceal.rc)
set(QTMAIN Qt5::WinMain)
elseif (UNIX)
if (APPLE)
enable_language(ASM)
file(GLOB_RECURSE OBJC_SOURCES src/*.mm)
set(SOURCES ${SOURCES} ${OBJC_SOURCES})
set(PLATFORM_DIR OSX)
set(MACOSX_BUNDLE_BUNDLE_NAME ${CN_PROJECT_NAME})
set(MACOSX_BUNDLE_INFO_STRING ${CN_VERSION})
set(MACOSX_BUNDLE_LONG_VERSION_STRING ${CN_VERSION})
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${CN_VERSION})
set(MACOSX_BUNDLE_BUNDLE_VERSION ${CN_VERSION})
find_package(Qt5PrintSupport REQUIRED)
include_directories(/usr/include/malloc)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_FLAG} -maes -std=c++11 -stdlib=libc++")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${ARCH_FLAG} -maes -D_DARWIN_C_SOURCE")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa -framework OpenGL -framework CoreFoundation -framework Carbon -framework IOKit -L/usr/lib")
set(MACOSX_BUNDLE_ICON_FILE conceal.icns)
set(APPLICATION_ICON src/images/appicon/conceal.icns)
set_source_files_properties(${APPLICATION_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
set(BUILD_PLATFORM MACOSX_BUNDLE)
set(BUILD_RESOURCES ${APPLICATION_ICON})
GET_TARGET_PROPERTY(QT_LIB_DIR "${Qt5Widgets_LIBRARIES}" LOCATION)
GET_FILENAME_COMPONENT(QT_LIB_DIR "${QT_LIB_DIR}" PATH)
else(APPLE)
set(PLATFORM_DIR Linux)
if(NOT ARM)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes -std=c++11")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes -std=c11")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
endif(NOT ARM)
endif (APPLE)
endif ()
include_directories(cryptonote/src/Platform/${PLATFORM_DIR})
file(GLOB PLATFORM_SOURCES cryptonote/src/Platform/${PLATFORM_DIR}/System/*)
set(CRYPTONOTE_SOURCES ${CRYPTONOTE_SOURCES} ${PLATFORM_SOURCES})
add_library(${CRYPTONOTE_LIB} STATIC ${CRYPTONOTE_SOURCES})
if (APPLE OR ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
target_link_libraries(${CRYPTONOTE_LIB} ${Boost_LIBRARIES} -lresolv)
else ()
target_link_libraries(${CRYPTONOTE_LIB} ${Boost_LIBRARIES})
endif ()
set_target_properties(${CRYPTONOTE_LIB} PROPERTIES COMPILE_DEFINITIONS _GNU_SOURCE)
add_executable(${PROJECT_NAME} ${BUILD_PLATFORM} ${BUILD_RESOURCES} ${SOURCES} ${HEADERS} ${UIS} ${RCC})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_DEFINITIONS _GNU_SOURCE)
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES} ${QTMAIN} ${CRYPTONOTE_LIB} ${QRENCODE_LIB})
if (APPLE)
qt5_use_modules(${PROJECT_NAME} PrintSupport)
add_definitions(/DHAVE_ROTR)
elseif (UNIX)
target_link_libraries(${PROJECT_NAME} -lpthread)
add_definitions(/DHAVE_ROTR)
elseif (WIN32)
target_link_libraries(${PROJECT_NAME} Imm32 Iphlpapi Winmm)
endif (APPLE)
# qt5_use_modules(${PROJECT_NAME} Widgets Gui Network)
target_link_libraries(${PROJECT_NAME} Qt5::Gui)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} Qt5::Network)
if(Qt5Charts_FOUND)
add_definitions(/DHAVE_CHART)
target_link_libraries(${PROJECT_NAME} Qt5::Charts)
endif(Qt5Charts_FOUND)
# Installation
set(CPACK_PACKAGE_NAME ${CN_PROJECT_NAME})
set(CPACK_PACKAGE_VERSION ${CN_VERSION})
set(CPACK_PACKAGE_VENDOR "The Circle Foundation")
set(CPACK_PACKAGE_CONTACT "https://github.com/TheCircleFoundation/")
set(CPACK_STRIP_FILES ON)
if (APPLE)
set(CPACK_GENERATOR DragNDrop)
install(TARGETS ${PROJECT_NAME} BUNDLE DESTINATION .)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}.-${VERSION_RELEASE}")
elseif (UNIX)
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
install(FILES src/concealwallet.desktop DESTINATION share/applications)
install(FILES src/images/conceal.png DESTINATION share/pixmaps)
install(FILES COPYRIGHT DESTINATION share/doc/concealwallet)
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
SET(CPACK_PACKAGE_ICON src/images/conceal.png)
if (NOT PACKRPM)
set(CPACK_GENERATOR DEB)
set(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
set(CPACK_SYSTEM_NAME amd64)
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_VENDOR} <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_SECTION Office)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Conceal Desktop (GUI Wallet)
Conceal is a decentralized privacy protected peer-to-peer
cryptocurrency and untraceable encrypted messaging system. Conceal is
open-source; its design is public, nobody owns or controls Conceal and
everyone can take part.
.
Features of the Conceal wallet listed bellow:
* Classic Bitcoin alike appearance in CryptoNote based cryptocurrency,
made with QT and open-source.
* Instant anonymous CCX transfers and transfers notifications
* Instant untraceable encrypted messages transfers and notifications
* Safe and secure, full Conceal network node in wallet, fast network
syncronization.
* Wallet encryption
* Fast and hardware optimized
* Open and easy. Private keys can be exported into other clients.")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_DEBIAN_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${VERSION_RELEASE}.${CPACK_SYSTEM_NAME}")
else ()
set(CPACK_GENERATOR RPM)
set(CPACK_SYSTEM_NAME x86_64)
set(CPACK_RPM_PACKAGE_RELEASE ${VERSION_RELEASE})
set(CPACK_RPM_PACKAGE_LICENSE "GPL3")
set(CPACK_RPM_PACKAGE_GROUP Office)
set(CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.3.2, qt5-qtbase-gui >= 5.3.2")
set(CPACK_RPM_PACKAGE_SUMMARY "Conceal Desktop (GUI Wallet)")
set(CPACK_RPM_PACKAGE_DESCRIPTION "Open-source Conceal Desktop (GUI Wallet)
Conceal is a decentralized privacy protected peer-to-peer
cryptocurrency and untraceable encrypted messaging system. Conceal is
open-source; its design is public, nobody owns or controls Conceal and
everyone can take part.
Features of the Conceal wallet listed bellow:
*Classic Bitcoin alike appearance in CryptoNote based cryptocurrency,
made with QT and open-source.
*Instant anonymous Conceal transfers and transfers notifications
*Instant untraceable encrypted messages transfers and notifications
*Safe and secure, full Conceal network node in wallet, fast network
syncronization.
*Wallet encryption
*Fast and hardware optimized
*Open and easy. Private keys can be exported into other clients.")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${VERSION_RELEASE}.${CPACK_SYSTEM_NAME}")
endif ()
elseif (WIN32)
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION .)
set(CPACK_GENERATOR ZIP)
endif (APPLE)
include(CPack)