-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
756 lines (686 loc) · 24.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
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
cmake_minimum_required(VERSION 3.2.0)
project(Neblio)
message(FATAL_ERROR "This cmake file is only for development. Please use qmake to build the project.")
cmake_host_system_information(RESULT hostname QUERY HOSTNAME)
message("Building on machine: " ${hostname})
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-variable -Wno-unused-function -Wno-unused-private-field")
if(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
endif()
option(COMPILE_GUI "Enable compiling neblio-qt" OFF)
option(COMPILE_DAEMON "Enable compiling nebliod" ON)
option(COMPILE_CURL "Download and compile libcurl (and OpenSSL) automatically (Not for Windows)" OFF)
option(USE_QRCODE "Enable QRCode" OFF)
option(USE_UPNP "Enable Miniupnpc" OFF)
option(USE_DBUS "Enable Dbus" ON)
option(USE_CUSTOM_WARNINGS "Enable custom warnings" OFF)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_SOURCE_DIR}/cmake")
add_definitions("-DQT_STATICPLUGIN")
message("Printing...")
foreach(plugin ${Qt5Widgets_PLUGINS})
get_target_property(_loc ${plugin} LOCATION)
message("Plugin ${plugin} is at location ${_loc}")
endforeach()
set(Boost_USE_STATIC_LIBS 1)
set(Boost_USE_STATIC_RUNTIME 1)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5LinguistTools REQUIRED)
find_package(BerkeleyDB REQUIRED)
find_package(PkgConfig REQUIRED)
find_package(Boost 1.55 COMPONENTS system random filesystem thread regex program_options iostreams REQUIRED)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
find_package(ZLIB REQUIRED)
if(COMPILE_CURL AND NOT WIN32)
include(FindPythonInterp)
if( !PYTHONINTERP_FOUND )
message( FATAL_ERROR "Could not find a Python interpreter. A python interpreter is requirered to compile curl." )
endif()
if(IS_SYMLINK "${CMAKE_BINARY_DIR}/openssl_build" OR EXISTS "${CMAKE_BINARY_DIR}/openssl_build")
else()
message("Compiling OpenSSL...")
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/build_scripts/CompileOpenSSL-Linux.py"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
OUTPUT_VARIABLE COMPILE_OPENSSL_OUTPUT
ERROR_VARIABLE COMPILE_OPENSSL_OUTPUT
RESULT_VARIABLE COMPILE_OPENSSL_RETURN_VALUE
)
if (NOT COMPILE_OPENSSL_RETURN_VALUE EQUAL 0)
message(FATAL_ERROR "Failed to compile OpenSSL: ${COMPILE_OPENSSL_OUTPUT}")
endif()
message("Done compiling OpenSSL.")
endif()
if(IS_SYMLINK "${CMAKE_BINARY_DIR}/curl_build" OR EXISTS "${CMAKE_BINARY_DIR}/curl_build")
else()
message("Compiling libcurl...")
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/build_scripts/CompileCurl-Linux.py"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
OUTPUT_VARIABLE COMPILE_CURL_OUTPUT
ERROR_VARIABLE COMPILE_CURL_OUTPUT
RESULT_VARIABLE COMPILE_CURL_RETURN_VALUE
)
if (NOT COMPILE_CURL_RETURN_VALUE EQUAL 0)
message(FATAL_ERROR "Failed to compile OpenSSL: ${COMPILE_CURL_OUTPUT}")
endif()
message("Done compiling libcurl.")
endif()
SET(ENV{PKG_CONFIG_PATH} "${CMAKE_BINARY_DIR}/curl_build/lib/pkgconfig/:$ENV{PKG_CONFIG_PATH}")
SET(ENV{PKG_CONFIG_PATH} ":${CMAKE_BINARY_DIR}/openssl_build/lib/pkgconfig/:$ENV{PKG_CONFIG_PATH}")
endif()
############################## CURL and OpenSSL PkgConfig
execute_process(
COMMAND "${PKG_CONFIG_EXECUTABLE}" "libcurl" "--libs"
OUTPUT_VARIABLE CURL_LIBS
ERROR_VARIABLE CURL_LIBS
RESULT_VARIABLE CURL_LIBS_RETURN_VALUE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (NOT CURL_LIBS_RETURN_VALUE EQUAL 0)
message(FATAL_ERROR "Failed to retrieve libs for libcurl with pkg-config: ${CURL_LIBS} ")
endif()
execute_process(
COMMAND "${PKG_CONFIG_EXECUTABLE}" "libcurl" "--cflags"
OUTPUT_VARIABLE CURL_INCLUDES
ERROR_VARIABLE CURL_INCLUDES
RESULT_VARIABLE CURL_INCLUDES_RETURN_VALUE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (NOT CURL_INCLUDES_RETURN_VALUE EQUAL 0)
message(FATAL_ERROR "Failed to retrieve libs for libcurl with pkg-config: ${CURL_INCLUDES}")
endif()
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} openssl --libs
OUTPUT_VARIABLE OPENSSL_LIBS
ERROR_VARIABLE OPENSSL_LIBS
RESULT_VARIABLE OPENSSL_LIBS_RETURN_VALUE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (NOT OPENSSL_LIBS_RETURN_VALUE EQUAL 0)
message(FATAL_ERROR "Failed to retrieve libs for openssl with pkg-config: ${OPENSSL_LIBS}")
endif()
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} openssl --cflags
OUTPUT_VARIABLE OPENSSL_INCLUDES
ERROR_VARIABLE OPENSSL_INCLUDES
RESULT_VARIABLE OPENSSL_INCLUDES_RETURN_VALUE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (NOT OPENSSL_INCLUDES_RETURN_VALUE EQUAL 0)
message(FATAL_ERROR "Failed to retrieve libs for openssl with pkg-config: ${OPENSSL_INCLUDES}")
endif()
add_definitions(-DCURL_STATICLIB)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPENSSL_INCLUDES} ${CURL_INCLUDES}")
################################################
if(USE_DBUS)
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} dbus-1 --libs
OUTPUT_VARIABLE DBUS_LIBRARY_DIRS
ERROR_VARIABLE DBUS_LIBRARY_DIRS
RESULT_VARIABLE DBUS_LIBS_RETURN_VALUE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (NOT DBUS_LIBS_RETURN_VALUE EQUAL 0)
message(FATAL_ERROR "Failed to retrieve libs for dbus with pkg-config: ${DBUS_LIBRARY_DIRS}")
endif()
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} dbus-1 --cflags
OUTPUT_VARIABLE DBUS_INCLUDE_DIRS
ERROR_VARIABLE DBUS_INCLUDE_DIRS
RESULT_VARIABLE DBUS_INCLUDES_RETURN_VALUE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (NOT DBUS_INCLUDES_RETURN_VALUE EQUAL 0)
message(FATAL_ERROR "Failed to retrieve libs for dbus with pkg-config: ${DBUS_INCLUDE_DIRS}")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DBUS_LIBRARY_DIRS}") #TODO: this is causing a warning on clang 7
endif()
# copy "res", the resources dir to build dir
file(COPY "${CMAKE_SOURCE_DIR}/wallet/qt/res" DESTINATION "${CMAKE_BINARY_DIR}")
# read, modify then write the qrc file, remove "locale/" directory as it's not necessary when translation files are generated in build dir
file(READ ${CMAKE_SOURCE_DIR}/wallet/qt/bitcoin.qrc resources_file_data)
STRING(REGEX REPLACE "locale\/(bitcoin[a-zA-Z_]+\.qm)" "\\1" resources_file_data_mod "${resources_file_data}" )
FILE(WRITE ${CMAKE_BINARY_DIR}/bitcoin.qrc "${resources_file_data_mod}")
set(RESOURCE ${CMAKE_BINARY_DIR}/bitcoin.qrc)
qt5_add_resources(RESOURCE_ADDED ${RESOURCE})
add_definitions(-DBOOST_SPIRIT_THREADSAFE)
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.12 -arch x86_64 -Wno-nullability-completeness -Wno-unused-command-line-argument")
add_library(mac_libs
qt/macdockiconhandler.h
qt/macnotificationhandler.h
qt/macdockiconhandler.mm
qt/macnotificationhandler.mm
)
target_link_libraries(mac_libs
-framework Foundation -framework ApplicationServices -framework AppKit
)
add_definitions(-DMAC_OSX MSG_NOSIGNAL=0)
# NOTE: Don't include the path in MACOSX_BUNDLE_ICON_FILE -- this is
# the property added to Info.plist
set(MACOSX_BUNDLE_ICON_FILE qt/res/icons/bitcoin.icns)
# And this part tells CMake where to find and install the file itself
set(myApp_ICON ${CMAKE_CURRENT_SOURCE_DIR}/images/myAppImage.icns)
set_source_files_properties(${myApp_ICON} PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources")
endif()
if(UNIX AND NOT APPLE)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-Bstatic")
add_definitions(-DLINUX)
endif()
if(NOT WIN32)
# for extra security against potential buffer overflows: enable GCCs Stack Smashing Protection
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-all -Wstack-protector")
# We need to exclude this for Windows cross compile with MinGW 4.2.x, as it will result in a non-working executable!
# This can be enabled for Windows, when we switch to MinGW >= 4.4.x.
endif()
# for extra security (see: https://wiki.debian.org/Hardening)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORTIFY_SOURCE=2")
if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-z,relro -Wl,-z,now")
endif()
if(WIN32)
# for extra security on Windows: enable ASLR and DEP via GCC linker flags
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -Wl,--dynamicbase -Wl,--nxcompat")
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -Wl,--large-address-aware -static")
add_definitions(-DWIN32)
add_definitions(-D_MT -DBOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN)
set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -lmingwthrd -mthreads")
set(CMAKE_CXX_FLAGS "-Wno-unused-variable")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-Bstatic")
endif()
# TODO
#contains(BITCOIN_NEED_QT_PLUGINS, 1) {
# DEFINES += BITCOIN_NEED_QT_PLUGINS
# QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
#}
#############################################################
# lmdb
# Check whether we're on a 32-bit or 64-bit system
if(CMAKE_SIZEOF_VOID_P EQUAL "8")
set(DEFAULT_LMDB64 ON)
else()
set(DEFAULT_LMDB64 OFF)
endif()
option(USE_LMDB64 "Build LMDB for 64-bit? 'OFF' builds for 32-bit." ${DEFAULT_LMDB64})
add_subdirectory(wallet/liblmdb)
include_directories(${LMDB_INCLUDE})
#############################################################
###################
# generate build.h
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/build")
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/build/build.h
COMMAND /bin/sh ${CMAKE_SOURCE_DIR}/share/genbuild.sh ${CMAKE_BINARY_DIR}/build/build.h
)
set_property(SOURCE ${CMAKE_BINARY_DIR}/build/build.h PROPERTY SKIP_AUTOMOC ON)
###################
if(CMAKE_SIZEOF_VOID_P EQUAL "4") # 32-bit compiler
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
endif()
if(USE_CUSTOM_WARNINGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-show-option -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector")
endif()
# TODO: from qmake. Is this necessary?
# CODECFORTR = UTF-8
qt5_add_translation(QM_FILES
wallet/qt/locale/bitcoin_af_ZA.ts
wallet/qt/locale/bitcoin_ar.ts
wallet/qt/locale/bitcoin_be_BY.ts
wallet/qt/locale/bitcoin_bg.ts
wallet/qt/locale/bitcoin_bs.ts
wallet/qt/locale/bitcoin_ca.ts
wallet/qt/locale/[email protected]
wallet/qt/locale/bitcoin_ca_ES.ts
wallet/qt/locale/bitcoin_cs.ts
wallet/qt/locale/bitcoin_cy.ts
wallet/qt/locale/bitcoin_da.ts
wallet/qt/locale/bitcoin_de.ts
wallet/qt/locale/bitcoin_el_GR.ts
wallet/qt/locale/bitcoin_en.ts
wallet/qt/locale/bitcoin_eo.ts
wallet/qt/locale/bitcoin_es.ts
wallet/qt/locale/bitcoin_es_CL.ts
wallet/qt/locale/bitcoin_es_DO.ts
wallet/qt/locale/bitcoin_es_MX.ts
wallet/qt/locale/bitcoin_es_UY.ts
wallet/qt/locale/bitcoin_et.ts
wallet/qt/locale/bitcoin_eu_ES.ts
wallet/qt/locale/bitcoin_fa.ts
wallet/qt/locale/bitcoin_fa_IR.ts
wallet/qt/locale/bitcoin_fi.ts
wallet/qt/locale/bitcoin_fr.ts
wallet/qt/locale/bitcoin_fr_CA.ts
wallet/qt/locale/bitcoin_gl.ts
wallet/qt/locale/bitcoin_he.ts
wallet/qt/locale/bitcoin_hi_IN.ts
wallet/qt/locale/bitcoin_hr.ts
wallet/qt/locale/bitcoin_hu.ts
wallet/qt/locale/bitcoin_id_ID.ts
wallet/qt/locale/bitcoin_it.ts
wallet/qt/locale/bitcoin_ja.ts
wallet/qt/locale/bitcoin_ka.ts
wallet/qt/locale/bitcoin_kk_KZ.ts
wallet/qt/locale/bitcoin_ko_KR.ts
wallet/qt/locale/bitcoin_ky.ts
wallet/qt/locale/bitcoin_la.ts
wallet/qt/locale/bitcoin_lt.ts
wallet/qt/locale/bitcoin_lv_LV.ts
wallet/qt/locale/bitcoin_ms_MY.ts
wallet/qt/locale/bitcoin_nb.ts
wallet/qt/locale/bitcoin_nl.ts
wallet/qt/locale/bitcoin_pam.ts
wallet/qt/locale/bitcoin_pl.ts
wallet/qt/locale/bitcoin_pt_BR.ts
wallet/qt/locale/bitcoin_pt_PT.ts
wallet/qt/locale/bitcoin_ro_RO.ts
wallet/qt/locale/bitcoin_ru.ts
wallet/qt/locale/bitcoin_sah.ts
wallet/qt/locale/bitcoin_sk.ts
wallet/qt/locale/bitcoin_sl_SI.ts
wallet/qt/locale/bitcoin_sq.ts
wallet/qt/locale/bitcoin_sr.ts
wallet/qt/locale/bitcoin_sv.ts
wallet/qt/locale/bitcoin_th_TH.ts
wallet/qt/locale/bitcoin_tr.ts
wallet/qt/locale/bitcoin_uk.ts
wallet/qt/locale/bitcoin_ur_PK.ts
wallet/qt/locale/bitcoin_vi.ts
wallet/qt/locale/bitcoin_vi_VN.ts
wallet/qt/locale/bitcoin_zh_CN.ts
wallet/qt/locale/bitcoin_zh_TW.ts
)
if(USE_QRCODE AND COMPILE_GUI)
include(FindPythonInterp)
if( !PYTHONINTERP_FOUND )
message( FATAL_ERROR "Could not find a Python interpreter. A python interpreter is requirered to compile qrencode." )
endif()
if(NOT WIN32)
if(IS_SYMLINK "${CMAKE_BINARY_DIR}/qrencode_build" OR EXISTS "${CMAKE_BINARY_DIR}/qrencode_build")
else()
message("Compiling qrencode...")
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/build_scripts/CompileQREncode-Linux.py"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
OUTPUT_VARIABLE COMPILE_QRENCODE_OUTPUT
ERROR_VARIABLE COMPILE_QRENCODE_OUTPUT
RESULT_VARIABLE COMPILE_QRENCODE_RETURN_VALUE
)
if (NOT COMPILE_QRENCODE_RETURN_VALUE EQUAL 0)
message(FATAL_ERROR "Failed to compile OpenSSL: ${COMPILE_QRENCODE_OUTPUT}")
endif()
message("Done compiling qrencode.")
endif()
endif()
SET(ENV{PKG_CONFIG_PATH} "${CMAKE_BINARY_DIR}/qrencode_build/lib/pkgconfig/:$ENV{PKG_CONFIG_PATH}")
execute_process(
COMMAND "${PKG_CONFIG_EXECUTABLE}" "libqrencode" "--libs"
OUTPUT_VARIABLE QRENCODE_LIBS
ERROR_VARIABLE QRENCODE_LIBS
RESULT_VARIABLE QRENCODE_LIBS_RETURN_VALUE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (NOT QRENCODE_LIBS_RETURN_VALUE EQUAL 0)
message(FATAL_ERROR "Failed to retrieve libs for libqrencode with pkg-config: ${QRENCODE_LIBS} ")
endif()
execute_process(
COMMAND "${PKG_CONFIG_EXECUTABLE}" "libqrencode" "--cflags"
OUTPUT_VARIABLE QRENCODE_INCLUDES
ERROR_VARIABLE QRENCODE_INCLUDES
RESULT_VARIABLE QRENCODE_INCLUDES_RETURN_VALUE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(QRCODE_SOURCES "wallet/qt/qrcodedialog.cpp" "wallet/qt/ui_qrcodedialog.h")
add_definitions(-DUSE_QRCODE)
endif()
add_library(gui_lib STATIC
wallet/qt/bitcoingui.cpp
wallet/qt/transactiontablemodel.cpp
wallet/qt/addresstablemodel.cpp
wallet/qt/optionsdialog.cpp
wallet/qt/sendcoinsdialog.cpp
wallet/qt/coincontroldialog.cpp
wallet/qt/coincontroltreewidget.cpp
wallet/qt/addressbookpage.cpp
wallet/qt/signverifymessagedialog.cpp
wallet/qt/aboutdialog.cpp
wallet/qt/editaddressdialog.cpp
wallet/qt/bitcoinaddressvalidator.cpp
wallet/qt/clientmodel.cpp
wallet/qt/guiutil.cpp
wallet/qt/transactionrecord.cpp
wallet/qt/optionsmodel.cpp
wallet/qt/monitoreddatamapper.cpp
wallet/qt/transactiondesc.cpp
wallet/qt/transactiondescdialog.cpp
wallet/qt/bitcoinstrings.cpp
wallet/qt/bitcoinamountfield.cpp
wallet/qt/transactionfilterproxy.cpp
wallet/qt/transactionview.cpp
wallet/qt/walletmodel.cpp
wallet/qt/overviewpage.cpp
wallet/qt/csvmodelwriter.cpp
wallet/qt/sendcoinsentry.cpp
wallet/qt/qvalidatedlineedit.cpp
wallet/qt/bitcoinunits.cpp
wallet/qt/qvaluecombobox.cpp
wallet/qt/askpassphrasedialog.cpp
wallet/qt/notificator.cpp
wallet/qt/qtipcserver.cpp
wallet/qt/rpcconsole.cpp
wallet/qt/ClickableLabel.cpp
wallet/qt/neblioupdatedialog.cpp
wallet/qt/messageboxwithtimer.cpp
${QRCODE_SOURCES}
)
if(USE_QRCODE)
target_compile_options(gui_lib PRIVATE ${QRENCODE_INCLUDES})
endif()
target_link_libraries(gui_lib
Qt5::Core
Qt5::Widgets
${QRENCODE_LIBS}
ui_lib
)
add_library(ui_lib STATIC
wallet/qt/ui_aboutdialog.h
wallet/qt/ui_addressbookpage.h
wallet/qt/ui_askpassphrasedialog.h
wallet/qt/ui_coincontroldialog.h
wallet/qt/ui_editaddressdialog.h
wallet/qt/ui_ntp1summary.h
wallet/qt/ui_optionsdialog.h
wallet/qt/ui_overviewpage.h
wallet/qt/ui_qrcodedialog.h
wallet/qt/ui_rpcconsole.h
wallet/qt/ui_sendcoinsdialog.h
wallet/qt/ui_sendcoinsentry.h
wallet/qt/ui_signverifymessagedialog.h
wallet/qt/ui_transactiondescdialog.h
)
target_link_libraries(ui_lib
Qt5::Core
Qt5::Widgets
)
add_library(ntp1_gui_lib STATIC
wallet/qt/ntp1summary.cpp
wallet/qt/ntp1/ntp1tokenlistmodel.cpp
wallet/qt/ntp1/ntp1tokenlistfilterproxy.cpp
wallet/qt/ntp1/ntp1tokenlistitemdelegate.cpp
wallet/qt/ntp1senddialog.cpp
wallet/qt/ntp1sendsingletokenfields.cpp
wallet/qt/ntp1sendtokensfeewidget.cpp
wallet/qt/json/AbstractTreeNode.cpp
wallet/qt/json/JsonNewNodeDialog.cpp
wallet/qt/json/JsonTreeModel.cpp
wallet/qt/json/JsonTreeNode.cpp
wallet/qt/json/JsonTreeView.cpp
wallet/qt/json/NTP1MetadataViewer.cpp
)
target_link_libraries(ntp1_gui_lib
Qt5::Core
Qt5::Widgets
ui_lib
)
add_library(core_lib STATIC
${CMAKE_BINARY_DIR}/build/build.h
wallet/alert.cpp
wallet/version.cpp
wallet/sync.cpp
wallet/util.cpp
wallet/hash.cpp
wallet/netbase.cpp
wallet/key.cpp
wallet/script.cpp
wallet/main.cpp
wallet/miner.cpp
wallet/net.cpp
wallet/bloom.cpp
wallet/checkpoints.cpp
wallet/addrman.cpp
wallet/db.cpp
wallet/walletdb.cpp
wallet/keystore.cpp
wallet/bitcoinrpc.cpp
wallet/rpcdump.cpp
wallet/rpcnet.cpp
wallet/rpcmining.cpp
wallet/rpcwallet.cpp
wallet/rpcblockchain.cpp
wallet/rpcrawtransaction.cpp
wallet/crypter.cpp
wallet/protocol.cpp
wallet/noui.cpp
wallet/kernel.cpp
wallet/scrypt-arm.S
wallet/scrypt-x86.S
wallet/scrypt-x86_64.S
wallet/scrypt.cpp
wallet/pbkdf2.cpp
wallet/neblioupdater.cpp
wallet/neblioversion.cpp
wallet/neblioreleaseinfo.cpp
wallet/ThreadSafeMap.cpp
wallet/ThreadSafeHashMap.cpp
wallet/NetworkForks.cpp
)
target_link_libraries(core_lib
ntp1_lib
curltools_lib
)
add_library(curltools_lib STATIC
wallet/curltools.cpp
)
if(USE_UPNP)
find_package(Miniupnpc REQUIRED)
message(Building without UPNP support)
target_link_libraries(core_lib -lminiupnpc)
target_compile_definitions(core_lib PRIVATE -DUSE_UPNP=1)
endif()
add_library(zerocoin_lib STATIC
wallet/zerocoin/Accumulator.cpp
wallet/zerocoin/AccumulatorProofOfKnowledge.cpp
wallet/zerocoin/Coin.cpp
wallet/zerocoin/CoinSpend.cpp
wallet/zerocoin/Commitment.cpp
wallet/zerocoin/ParamGeneration.cpp
wallet/zerocoin/Params.cpp
wallet/zerocoin/SerialNumberSignatureOfKnowledge.cpp
wallet/zerocoin/SpendMetaData.cpp
wallet/zerocoin/ZeroTest.cpp
)
add_library(ntp1_lib STATIC
wallet/ntp1/ntp1sendtokensdata.cpp
wallet/ntp1/ntp1sendtokensonerecipientdata.cpp
wallet/ntp1/ntp1script_burn.cpp
wallet/ntp1/ntp1tokenminimalmetadata.cpp
wallet/ntp1/ntp1sendtxdata.cpp
wallet/ntp1/ntp1tokenmetadata.cpp
wallet/ntp1/ntp1wallet.cpp
wallet/ntp1/ntp1tools.cpp
wallet/ntp1/ntp1inpoint.cpp
wallet/ntp1/ntp1outpoint.cpp
wallet/ntp1/ntp1transaction.cpp
wallet/ntp1/ntp1txin.cpp
wallet/ntp1/ntp1txout.cpp
wallet/ntp1/ntp1tokentxdata.cpp
wallet/ntp1/ntp1apicalls.cpp
wallet/ntp1/ntp1script.cpp
wallet/ntp1/ntp1script_issuance.cpp
wallet/ntp1/ntp1script_transfer.cpp
wallet/ntp1/ntp1v1_issuance_static_data.cpp
)
target_link_libraries(ntp1_lib
curltools_lib
)
add_library(json_spirit_lib STATIC
wallet/json/json_spirit_value.cpp
wallet/json/json_spirit_reader.cpp
wallet/json/json_spirit_writer.cpp
)
if(WIN32)
# this solves a problem of big string tables on Windows when building in debug mode
set_property(TARGET json_spirit_lib PROPERTY COMPILE_FLAGS "-O2")
endif()
add_library(txdb_lib STATIC
wallet/txdb-lmdb.cpp
)
target_link_libraries(txdb_lib
lmdb
)
target_link_libraries(curltools_lib
${CURL_LIBS}
${OPENSSL_LIBS}
)
include_directories(wallet)
include_directories(wallet/json)
target_include_directories(gui_lib PRIVATE wallet/qt)
target_include_directories(ntp1_gui_lib PRIVATE wallet/qt)
include_directories(${ZLIB_INCLUDE_DIRS})
# the following from here https://github.com/owncloud/client/blob/master/src/gui/CMakeLists.txt
target_compile_definitions(gui_lib PRIVATE "QT_DISABLE_DEPRECATED_BEFORE=0")
if(WIN32)
if(COMPILE_GUI)
add_executable(
neblio-qt
${RESOURCE_ADDED}
${QM_FILES}
wallet/qt/bitcoin.cpp
wallet/wallet.cpp
wallet/init.cpp
)
target_link_libraries(neblio-qt
gui_lib
ui_lib
ntp1_gui_lib
curltools_lib
zerocoin_lib
ntp1_lib
core_lib
json_spirit_lib
txdb_lib
-lpthread
### win32 libs
-lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32
##############
Boost::system
Boost::filesystem
Boost::thread
Boost::regex
Boost::program_options
Boost::iostreams
${BERKELEY_DB_LIBRARIES}
${CURL_LIBS}
${OPENSSL_LIBS}
${ZLIB_LIBRARIES}
)
target_compile_definitions(neblio-qt PRIVATE
QT_GUI
)
target_link_libraries(neblio-qt Qt5::QWindowsIntegrationPlugin)
endif()
if(COMPILE_DAEMON)
add_executable(
nebliod
wallet/wallet.cpp
wallet/init.cpp
)
target_link_libraries(nebliod
core_lib
zerocoin_lib
ntp1_lib
curltools_lib
json_spirit_lib
txdb_lib
-lpthread
### win32 libs
-lws2_32 -lshlwapi -lmswsock -lole32 -loleaut32 -luuid -lgdi32
##############
Boost::system
Boost::filesystem
Boost::thread
Boost::regex
Boost::program_options
${BERKELEY_DB_LIBRARIES}
${CURL_LIBS}
${OPENSSL_LIBS}
)
endif()
elseif(APPLE)
add_executable(
neblio-qt
MACOSX_BUNDLE ${myApp_ICON}
)
else()
if(COMPILE_GUI)
add_executable(
neblio-qt
${RESOURCE_ADDED}
${QM_FILES}
wallet/qt/bitcoin.cpp
wallet/wallet.cpp
wallet/init.cpp
)
target_link_libraries(neblio-qt
gui_lib
ui_lib
ntp1_gui_lib
curltools_lib
zerocoin_lib
ntp1_lib
core_lib
json_spirit_lib
txdb_lib
-lpthread
-lrt
-ldl
Boost::system
Boost::filesystem
Boost::thread
Boost::regex
Boost::program_options
Boost::iostreams
${BERKELEY_DB_LIBRARIES}
${CURL_LIBS}
${OPENSSL_LIBS}
${ZLIB_LIBRARIES}
)
target_compile_definitions(neblio-qt PRIVATE
QT_GUI
)
endif()
if(COMPILE_DAEMON)
add_executable(
nebliod
wallet/wallet.cpp
wallet/init.cpp
)
target_link_libraries(nebliod
core_lib
zerocoin_lib
ntp1_lib
curltools_lib
json_spirit_lib
txdb_lib
-lpthread
-lrt
-ldl
Boost::system
Boost::filesystem
Boost::thread
Boost::regex
Boost::program_options
Boost::iostreams
${BERKELEY_DB_LIBRARIES}
${CURL_LIBS}
${OPENSSL_LIBS}
${ZLIB_LIBRARIES}
)
endif()
endif()