forked from libbitcoin/libbitcoin-system
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
1233 lines (1056 loc) · 39.6 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
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# Copyright (c) 2017-2018 Bitprim developers (see AUTHORS)
#
# This file is part of Bitprim.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
cmake_minimum_required(VERSION 3.4)
# bitprim-core
#==============================================================================
project(bitprim-core
VERSION 0
LANGUAGES CXX C)
# VERSION 0.11.0
#if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# # using Clang
#elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# # using GCC
#elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# # using Intel C++
#elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# # using Visual Studio C++
#endif()
#if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# # using regular Clang or AppleClang
#endif()
# message(CMAKE_CXX_COMPILER_ID)
# message(${CMAKE_CXX_COMPILER_ID})
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Check for baseline language coverage in the compiler for the C++11 standard.
#------------------------------------------------------------------------------
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Process options.
#==============================================================================
# Implement --use-conan
#------------------------------------------------------------------------------
option(USE_CONAN "Use Conan Build Tool." OFF)
option(NO_CONAN_AT_ALL "Conan totally disabled." OFF)
if (NO_CONAN_AT_ALL)
set(USE_CONAN OFF)
endif()
# Inherit --enable-shared and define BOOST_TEST_DYN_LINK.
#------------------------------------------------------------------------------
option(ENABLE_SHARED "" OFF)
# Implement POSITION_INDEPENDENT_CODE
#------------------------------------------------------------------------------
option(ENABLE_POSITION_INDEPENDENT_CODE "Enable POSITION_INDEPENDENT_CODE property" ON)
# Implement --with-tests and declare WITH_TESTS.
#------------------------------------------------------------------------------
option(WITH_TESTS "Compile with unit tests." ON)
option(WITH_TESTS_NEW "Compile with unit tests." OFF)
# Implement --with-examples and declare WITH_EXAMPLES.
#------------------------------------------------------------------------------
option(WITH_EXAMPLES "Compile with examples." OFF)
# Implement --with-keoken and declare WITH_KEOKEN.
#------------------------------------------------------------------------------
option(WITH_KEOKEN "Keoken enabled." OFF)
if (WITH_KEOKEN)
message(STATUS "Bitprim: Keoken enabled")
add_definitions(-DBITPRIM_WITH_KEOKEN)
endif()
# Implement --with-icu and define BOOST_HAS_ICU and output ${icu}.
#------------------------------------------------------------------------------
option(WITH_ICU "Compile with International Components for Unicode." OFF)
if (WITH_ICU)
add_definitions(-DWITH_ICU -DBOOST_HAS_ICU)
if (NO_CONAN_AT_ALL)
message(FATAL_ERROR "WITH_ICU not yet implemented")
endif (NO_CONAN_AT_ALL)
endif()
# Implement --with-png and output ${png}.
#------------------------------------------------------------------------------
option(WITH_PNG "Compile with Libpng support." OFF)
if (WITH_PNG)
add_definitions(-DWITH_PNG)
endif()
# Implement --with-qrencode and output ${qrencode}.
#------------------------------------------------------------------------------
option(WITH_QRENCODE "Compile with QREncode." OFF)
if (WITH_QRENCODE)
add_definitions(-DWITH_QRENCODE)
if (NO_CONAN_AT_ALL)
message(FATAL_ERROR "WITH_QRENCODE not yet implemented")
endif (NO_CONAN_AT_ALL)
endif()
# Implement --JUST_BITPRIM_SOURCES for linting.
#------------------------------------------------------------------------------
option(JUST_BITPRIM_SOURCES "Just Bitprim source code to be linted." OFF)
if (JUST_BITPRIM_SOURCES)
message(STATUS "Bitprim: Just Bitprim source code to be linted: enabled")
endif()
set(BITPRIM_PROJECT_VERSION "-" CACHE STRING "Specify the Bitprim Project Version.")
# message(${BITPRIM_PROJECT_VERSION})
message( STATUS "Bitprim: Compiling version ${BITPRIM_PROJECT_VERSION}")
set(MICROARCHITECTURE "x86_64" CACHE STRING "Specify the Cryptocurrency (x86_64|...).")
message( STATUS "Bitprim: Compiling for ${MICROARCHITECTURE}")
# add_definitions(-DBITPRIM_MICROARCHITECTURE=${MICROARCHITECTURE})
# add_definitions(-DBITPRIM_MICROARCHITECTURE_STR="${MICROARCHITECTURE}")
set(CURRENCY "BCH" CACHE STRING "Specify the Cryptocurrency (BCH|BTC|LTC).")
if (${CURRENCY} STREQUAL "BCH")
add_definitions(-DBITPRIM_CURRENCY_BCH)
elseif (${CURRENCY} STREQUAL "BTC")
add_definitions(-DBITPRIM_CURRENCY_BTC)
elseif (${CURRENCY} STREQUAL "LTC")
add_definitions(-DBITPRIM_CURRENCY_LTC)
else()
message(FATAL_ERROR "Invalid Cryptocurrency: ${CURRENCY}")
endif()
message(STATUS "Bitprim: Cryptocurrency: ${CURRENCY}")
# Conan infrastructure
#==============================================================================
if(EXISTS ${CMAKE_SOURCE_DIR}/ci_utils/cmake/bitprimbuildinfo.cmake)
include(${CMAKE_SOURCE_DIR}/ci_utils/cmake/bitprimbuildinfo.cmake)
else()
message( STATUS "bitprimbuildinfo doent exists")
endif()
# get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS )
# foreach( d ${DirDefs} )
# message( STATUS "Found Define: " ${d} )
# endforeach()
# message( STATUS "DirDefs: " ${DirDefs} )
# remove_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
# remove_definitions(-D_GLIBCXX_USE_CXX11_ABI=1)
# get_directory_property( DirDefs DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS )
# foreach( d ${DirDefs} )
# message( STATUS "Found Define: " ${d} )
# endforeach()
# message( STATUS "DirDefs: " ${DirDefs} )
set(Boost_DEBUG ON)
# Check dependencies.
#==============================================================================
#------------------------------------------------------------------------------
if (NO_CONAN_AT_ALL)
# Require Boost of at least version 1.56.0 and output ${boost_CPPFLAGS/LDFLAGS}.
#------------------------------------------------------------------------------
if (NOT ENABLE_SHARED)
set(Boost_USE_STATIC_LIBS ON)
endif()
if (MSVC)
find_package(
Boost 1.56.0 REQUIRED
COMPONENTS atomic chrono date_time filesystem iostreams locale log log_setup program_options regex system thread unit_test_framework
)
else()
find_package(
Boost 1.56.0 REQUIRED
COMPONENTS chrono date_time filesystem iostreams locale log program_options regex system thread unit_test_framework
)
endif()
endif()
# Require pthread and output ${pthread_CPPFLAGS/LIBS}.
#------------------------------------------------------------------------------
find_package(Threads REQUIRED) #TODO(fernando): manage with conan
# Require png of at least version 1.6.25 and output ${png_CPPFLAGS/LIBS/PKG}.
#------------------------------------------------------------------------------
if (WITH_PNG)
if (NO_CONAN_AT_ALL)
find_package(PNG 1.6.25 REQUIRED)
add_library(png INTERFACE IMPORTED)
set_target_properties(png PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PNG_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${PNG_LIBRARIES}"
INTERFACE_COMPILE_DEFINITIONS "${PNG_DEFINITIONS}")
endif(NO_CONAN_AT_ALL)
endif()
# Require OpenSSL
#------------------------------------------------------------------------------
# if (WITH_LITECOIN)
if (${CURRENCY} STREQUAL "LTC")
find_package(OpenSSL 1.0.1 REQUIRED) #TODO(fernando): manage with conan
endif()
# Require rt if on linux and output ${rt_LIBS}.
#------------------------------------------------------------------------------
# Require icu-i18n of at least version 51.2 and output ${icu_i18n_CPPFLAGS/LIBS/PKG}.
#------------------------------------------------------------------------------
# Require qrencode of at least version 3.4.4 and output ${qrencode_CPPFLAGS/LIBS/PKG}.
if (NOT USE_CONAN)
# Require secp256k1 of at least version 0 and output ${secp256k1_CPPFLAGS/LIBS/PKG}.
#------------------------------------------------------------------------------
if (NOT TARGET secp256k1)
find_package(secp256k1 0 REQUIRED)
endif()
endif()
# Set flags.
#==============================================================================
include(CheckCXXCompilerFlag)
# Including common functions
#------------------------------------------------------------------------------
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/ci_utils/cmake)
include(BitprimTools)
# Warn on all stuff.
#------------------------------------------------------------------------------
if (NOT MSVC)
_add_c_compile_flag(-Wall _has_all_warning_flag)
else()
_add_c_compile_flag(-W4 _has_all_warning_flag)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
# Warn on extra stuff.
#------------------------------------------------------------------------------
if (NOT MSVC)
_add_c_compile_flag(-Wextra _has_extra_warning_flag)
endif()
# Be really annoying.
#------------------------------------------------------------------------------
_add_c_compile_flag(-Wpedantic _has_pedantic_warning_flag)
if (_has_pedantic_warning_flag)
_add_c_compile_flag(-pedantic _has_pedantic_flag)
endif()
# Conform to style.
#------------------------------------------------------------------------------
_add_cxx_compile_flag(-Wno-missing-braces _has_no_missing_braces_warning_flag)
# Conflict in stdlib under clang. Enabled in clang only.
#------------------------------------------------------------------------------
_add_cxx_compile_flag(-Wno-mismatched-tags _has_no_mismatched_tags_warning_flag)
# Clean up boost 1.55 headers. Enabled in gcc only.
#------------------------------------------------------------------------------
_add_c_compile_flag(-Wno-deprecated-declarations _has_no_deprecated_declarations_warning_flag)
# Protect stack.
#------------------------------------------------------------------------------
_add_link_flag(-fstack-protector _has_stack_protector_flag)
# Protect stack comprehensively.
#------------------------------------------------------------------------------
_add_link_flag(-fstack-protector-all _has_stack_protector_all_flag)
# Hide internal functions from external libs. Enabled in gcc only.
#------------------------------------------------------------------------------
_add_cxx_compile_flag(-fvisibility-hidden _has_visibility_hidden_flag)
# Hide inlines from external libs. Enabled in gcc only.
#------------------------------------------------------------------------------
_add_cxx_compile_flag(-fvisibility-inlines-hidden _has_visibility_inlines_hidden_flag)
# Target Windows Vista. Enabled in msvc only.
#------------------------------------------------------------------------------
if (MSVC) # OR MINGW)
add_definitions(-D_WIN32_WINNT=0x0600)
endif()
# Build
#==============================================================================
# src/bitprim-core.la => ${libdir}
#------------------------------------------------------------------------------
set(MODE STATIC)
if (ENABLE_SHARED)
set(MODE SHARED)
endif()
set(bitprim_core_sources_just_libbitcoin
src/chain/block.cpp
src/chain/chain_state.cpp
src/chain/compact.cpp
src/chain/header.cpp
src/chain/input.cpp
src/chain/output.cpp
src/chain/output_point.cpp
src/chain/point.cpp
src/chain/point_iterator.cpp
src/chain/point_value.cpp
src/chain/points_value.cpp
src/chain/script.cpp
src/chain/transaction.cpp
src/chain/witness.cpp
src/machine/interpreter.cpp
src/machine/number.cpp
src/machine/opcode.cpp
src/machine/operation.cpp
src/machine/program.cpp
src/config/authority.cpp
src/config/base16.cpp
src/config/base2.cpp
src/config/base58.cpp
src/config/base64.cpp
src/config/checkpoint.cpp
src/config/directory.cpp
src/config/endpoint.cpp
src/config/hash160.cpp
src/config/hash256.cpp
src/config/parameter.cpp
src/config/parser.cpp
src/config/printer.cpp
src/config/sodium.cpp
src/config/header.cpp
src/config/input.cpp
src/config/output.cpp
src/config/point.cpp
src/config/transaction.cpp
src/config/script.cpp
src/config/ec_private.cpp
src/config/endorsement.cpp
src/utility/property_tree.cpp
src/error.cpp
src/multi_crypto_support.cpp
src/version.cpp
src/formats/base_10.cpp
src/formats/base_16.cpp
src/formats/base_58.cpp
src/formats/base_64.cpp
src/formats/base_85.cpp
src/log/file_collector.cpp
src/log/file_collector_repository.cpp
src/log/file_counter_formatter.cpp
src/log/sink.cpp
src/log/statsd_sink.cpp
src/log/udp_client_sink.cpp
src/math/checksum.cpp
src/math/crypto.cpp
src/math/elliptic_curve.cpp
src/math/hash.cpp
src/math/secp256k1_initializer.cpp
src/math/secp256k1_initializer.hpp
src/math/sip_hash.cpp
src/math/stealth.cpp
src/math/external/aes256.h
src/math/external/crypto_scrypt.h
src/math/external/hmac_sha256.h
src/math/external/hmac_sha512.h
src/math/external/lax_der_parsing.h
src/math/external/pbkdf2_sha256.h
src/math/external/pkcs5_pbkdf2.h
src/math/external/ripemd160.h
src/math/external/scrypt.h
src/math/external/sha1.h
src/math/external/sha256.h
src/math/external/sha512.h
src/math/external/zeroize.h
src/math/external/aes256.c
src/math/external/crypto_scrypt.c
src/math/external/hmac_sha256.c
src/math/external/hmac_sha512.c
src/math/external/lax_der_parsing.c
src/math/external/pbkdf2_sha256.c
src/math/external/pkcs5_pbkdf2.c
src/math/external/ripemd160.c
src/math/external/sha1.c
src/math/external/sha256.c
src/math/external/sha512.c
src/math/external/zeroize.c
src/message/address.cpp
src/message/alert.cpp
src/message/alert_payload.cpp
src/message/block.cpp
src/message/block_transactions.cpp
src/message/compact_block.cpp
src/message/fee_filter.cpp
src/message/filter_add.cpp
src/message/filter_clear.cpp
src/message/filter_load.cpp
src/message/get_address.cpp
src/message/get_block_transactions.cpp
src/message/get_blocks.cpp
src/message/get_data.cpp
src/message/get_headers.cpp
src/message/header.cpp
src/message/headers.cpp
src/message/heading.cpp
src/message/inventory.cpp
src/message/inventory_vector.cpp
src/message/memory_pool.cpp
src/message/merkle_block.cpp
src/message/messages.cpp
src/message/network_address.cpp
src/message/not_found.cpp
src/message/ping.cpp
src/message/pong.cpp
src/message/prefilled_transaction.cpp
src/message/reject.cpp
src/message/send_compact.cpp
src/message/send_headers.cpp
src/message/transaction.cpp
src/message/verack.cpp
src/message/version.cpp
src/unicode/console_streambuf.cpp
src/unicode/ifstream.cpp
src/unicode/ofstream.cpp
src/unicode/unicode.cpp
src/unicode/unicode_istream.cpp
src/unicode/unicode_ostream.cpp
src/unicode/unicode_streambuf.cpp
src/utility/binary.cpp
src/utility/conditional_lock.cpp
src/utility/deadline.cpp
src/utility/dispatcher.cpp
src/utility/flush_lock.cpp
src/utility/interprocess_lock.cpp
src/utility/istream_reader.cpp
src/utility/monitor.cpp
src/utility/ostream_writer.cpp
src/utility/png.cpp
src/utility/prioritized_mutex.cpp
src/utility/pseudo_random.cpp
src/utility/scope_lock.cpp
src/utility/sequencer.cpp
src/utility/sequential_lock.cpp
src/utility/socket.cpp
src/utility/string.cpp
src/utility/thread.cpp
src/utility/threadpool.cpp
src/utility/work.cpp
src/wallet/bitcoin_uri.cpp
src/wallet/dictionary.cpp
src/wallet/ec_private.cpp
src/wallet/ec_public.cpp
src/wallet/ek_private.cpp
src/wallet/ek_public.cpp
src/wallet/ek_token.cpp
src/wallet/encrypted_keys.cpp
src/wallet/hd_private.cpp
src/wallet/hd_public.cpp
src/wallet/message.cpp
src/wallet/mini_keys.cpp
src/wallet/mnemonic.cpp
src/wallet/parse_encrypted_keys/parse_encrypted_key.hpp
src/wallet/parse_encrypted_keys/parse_encrypted_key.ipp
src/wallet/parse_encrypted_keys/parse_encrypted_prefix.hpp
src/wallet/parse_encrypted_keys/parse_encrypted_prefix.ipp
src/wallet/parse_encrypted_keys/parse_encrypted_private.cpp
src/wallet/parse_encrypted_keys/parse_encrypted_private.hpp
src/wallet/parse_encrypted_keys/parse_encrypted_public.cpp
src/wallet/parse_encrypted_keys/parse_encrypted_public.hpp
src/wallet/parse_encrypted_keys/parse_encrypted_token.cpp
src/wallet/parse_encrypted_keys/parse_encrypted_token.hpp
src/wallet/payment_address.cpp
src/wallet/qrcode.cpp
src/wallet/select_outputs.cpp
src/wallet/select_outputs.cpp
src/wallet/stealth_address.cpp
src/wallet/stealth_receiver.cpp
src/wallet/stealth_sender.cpp
src/wallet/uri.cpp
src/wallet/transaction_functions.cpp
)
set(bitprim_core_sources_just_bitprim
)
if (${CURRENCY} STREQUAL "BCH")
set(bitprim_core_sources_just_bitprim
${bitprim_core_sources_just_bitprim}
src/wallet/cashaddr.cpp)
endif()
if (${CURRENCY} STREQUAL "LTC")
set(bitprim_core_sources_just_bitprim
${bitprim_core_sources_just_bitprim}
src/math/external/scrypt.cpp
src/math/external/scrypt-sse2.cpp)
endif()
if (WITH_KEOKEN)
set(bitprim_core_sources_just_bitprim
${bitprim_core_sources_just_bitprim}
src/bitprim/keoken/transaction_extractor.cpp
src/bitprim/keoken/entities/asset.cpp
src/bitprim/keoken/message/base.cpp
src/bitprim/keoken/message/create_asset.cpp
src/bitprim/keoken/message/send_tokens.cpp
src/bitprim/keoken/wallet/create_transanction.cpp
)
endif()
if (NOT JUST_BITPRIM_SOURCES)
set(bitprim_core_sources
${bitprim_core_sources_just_libbitcoin}
)
endif()
set(bitprim_core_sources
${bitprim_core_sources}
${bitprim_core_sources_just_bitprim}
)
add_library(bitprim-core ${MODE} ${bitprim_core_sources})
if (ENABLE_POSITION_INDEPENDENT_CODE)
set_property(TARGET bitprim-core PROPERTY POSITION_INDEPENDENT_CODE ON)
endif(ENABLE_POSITION_INDEPENDENT_CODE)
#set_target_properties(bitprim-core PROPERTIES CXX_VISIBILITY_PRESET hidden)
#set_target_properties(bitprim-core PROPERTIES CXX_VISIBILITY_PRESET internal)
#-fvisibility=default|internal|hidden|protected
# add_library(bitprim-core ${MODE}
# src/wallet/uri.cpp)
target_include_directories(bitprim-core PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
if (NOT ENABLE_SHARED)
target_compile_definitions(bitprim-core PUBLIC -DBC_STATIC) #TODO(fernando): manage with Conan????
endif()
target_compile_definitions(bitprim-core PUBLIC -DBITPRIM_PROJECT_VERSION="${BITPRIM_PROJECT_VERSION}") #TODO(fernando): manage with Conan????
target_include_directories(bitprim-core SYSTEM PUBLIC ${Boost_INCLUDE_DIR})
# if (WITH_LITECOIN)
if (${CURRENCY} STREQUAL "LTC")
target_include_directories(bitprim-core SYSTEM PUBLIC ${OPENSSL_INCLUDE_DIR})
endif()
if (NOT NO_CONAN_AT_ALL)
target_link_libraries(bitprim-core PUBLIC ${CONAN_LIBS})
else()
if (MSVC)
target_link_libraries(bitprim-core PUBLIC
${Boost_ATOMIC_LIBRARY}
${Boost_LOG_SETUP_LIBRARY}
)
endif()
target_link_libraries(bitprim-core PUBLIC
${Boost_CHRONO_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
${Boost_LOCALE_LIBRARY}
${Boost_LOG_LIBRARY}
${Boost_PROGRAM_OPTIONS_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_THREAD_LIBRARY}
)
endif()
target_link_libraries(bitprim-core PUBLIC ${CMAKE_THREAD_LIBS_INIT}) #TODO(fernando): manage with Conan????
# if (NO_CONAN_AT_ALL)
if (MINGW) #(WIN32)
target_link_libraries(bitprim-core PUBLIC ws2_32 wsock32)
endif()
# endif()
if (WITH_PNG)
if (NO_CONAN_AT_ALL)
target_link_libraries(bitprim-core PUBLIC png)
endif (NO_CONAN_AT_ALL)
endif()
if (${CURRENCY} STREQUAL "LTC")
target_link_libraries(bitprim-core PUBLIC ${OPENSSL_CRYPTO_LIBRARY}) #TODO(fernando): manage with Conan
# OPENSSL_CRYPTO_LIBRARY
# OPENSSL_SSL_LIBRARY
# OPENSSL_LIBRARIES
endif()
if (NOT USE_CONAN)
target_link_libraries(bitprim-core PUBLIC secp256k1)
endif()
_group_sources(bitprim-core "${CMAKE_CURRENT_LIST_DIR}")
# Tests
#==============================================================================
if (WITH_TESTS OR WITH_TESTS_NEW)
enable_testing()
endif()
# local: test/bitprim_core_test
#------------------------------------------------------------------------------
if (WITH_TESTS)
add_executable(bitprim_core_test
test/chain/block.cpp
test/chain/header.cpp
test/chain/input.cpp
test/chain/output.cpp
test/chain/output_point.cpp
test/chain/point.cpp
test/chain/point_iterator.cpp
test/chain/satoshi_words.cpp
# test/chain/machine/opcode.cpp #TODO: check the new test sources to be added after the Feb2017 merge
# test/chain/script/operation.cpp
# test/chain/script/script.cpp
# test/chain/script/script.hpp
test/chain/script.cpp
test/chain/transaction.cpp
test/config/authority.cpp
test/config/base58.cpp
test/config/checkpoint.cpp
test/config/endpoint.cpp
test/config/hash256.cpp
test/config/parameter.cpp
test/config/printer.cpp
test/formats/base_10.cpp
test/formats/base_16.cpp
test/formats/base_58.cpp
test/formats/base_64.cpp
test/formats/base_85.cpp
test/main.cpp
# test/math/big_number.cpp
# test/math/big_number.hppcompact
test/math/checksum.cpp
test/math/elliptic_curve.cpp
test/math/hash.cpp
test/math/hash.hpp
# test/math/hash_number.cpp
test/math/limits.cpp
# test/math/script_number.cpp
# test/math/script_number.hpp
test/math/stealth.cpp
test/message/address.cpp
test/message/alert.cpp
test/message/alert_payload.cpp
# test/message/block_message.cpp
test/message/block.cpp
test/message/block_transactions.cpp
test/message/compact_block.cpp
test/message/fee_filter.cpp
test/message/filter_add.cpp
test/message/filter_clear.cpp
test/message/filter_load.cpp
test/message/get_address.cpp
test/message/get_block_transactions.cpp
test/message/get_blocks.cpp
test/message/get_data.cpp
test/message/get_headers.cpp
# test/message/header_message.cpp
test/message/headers.cpp
test/message/heading.cpp
test/message/inventory.cpp
test/message/inventory_vector.cpp
test/message/memory_pool.cpp
test/message/merkle_block.cpp
test/message/network_address.cpp
test/message/not_found.cpp
test/message/ping.cpp
test/message/pong.cpp
test/message/prefilled_transaction.cpp
test/message/reject.cpp
# test/message/send_compact_blocks.cpp
test/message/send_headers.cpp
# test/message/transaction_message.cpp
test/message/transaction.cpp
test/message/verack.cpp
test/message/version.cpp
test/unicode/unicode.cpp
test/unicode/unicode_istream.cpp
test/unicode/unicode_ostream.cpp
test/utility/binary.cpp
test/utility/collection.cpp
test/utility/data.cpp
test/utility/endian.cpp
test/utility/png.cpp
test/utility/pseudo_random.cpp
test/utility/serializer.cpp
test/utility/stream.cpp
test/utility/thread.cpp
# test/utility/variable_uint_size.cpp
test/wallet/bitcoin_uri.cpp
test/wallet/ec_private.cpp
test/wallet/ec_public.cpp
test/wallet/encrypted_keys.cpp
test/wallet/hd_private.cpp
test/wallet/hd_public.cpp
test/wallet/message.cpp
test/wallet/mnemonic.cpp
test/wallet/mnemonic.hpp
test/wallet/payment_address.cpp
test/wallet/qrcode.cpp
test/wallet/stealth_address.cpp
test/wallet/uri.cpp
test/wallet/uri_reader.cpp
test/wallet/transaction_functions.cpp
)
# Simplified Test Project for testing Packaging purposes
# add_executable(bitprim_core_test
# test/main.cpp
# # test/math/big_number.cpp
# # test/math/big_number.hppcompact
# test/math/checksum.cpp
# test/math/elliptic_curve.cpp
# test/math/hash.cpp
# test/math/hash.hpp
# # test/math/hash_number.cpp
# test/math/limits.cpp
# # test/math/script_number.cpp
# # test/math/script_number.hpp
# test/math/stealth.cpp
# test/wallet/bitcoin_uri.cpp
# test/wallet/ec_private.cpp
# test/wallet/ec_public.cpp
# test/wallet/encrypted_keys.cpp
# test/wallet/hd_private.cpp
# test/wallet/hd_public.cpp
# test/wallet/message.cpp
# test/wallet/mnemonic.cpp
# test/wallet/mnemonic.hpp
# test/wallet/payment_address.cpp
# test/wallet/qrcode.cpp
# test/wallet/stealth_address.cpp
# test/wallet/uri.cpp
# test/wallet/uri_reader.cpp)
target_link_libraries(bitprim_core_test PUBLIC bitprim-core)
_group_sources(bitprim_core_test "${CMAKE_CURRENT_LIST_DIR}/test")
# TODO: Fer: chequear si hay nuevos tests en los makefiles (no Cmake)
_add_tests(bitprim_core_test
address_tests
alert_payload_tests
alert_tests
authority_tests
base_10_tests
base_16_tests
base_58_tests
base_64_tests
base_85_tests
base58_tests
binary_tests
bitcoin_uri_tests
chain_block_tests
message_block_tests
block_transactions_tests
checkpoint_tests
checksum_tests
collection_tests
compact_block_tests
data_tests
ec_private_tests
# ec_public_tests # no test cases
elliptic_curve_tests
encrypted_tests
endian_tests
endpoint_tests
fee_filter_tests
filter_add_tests
filter_clear_tests
filter_load_tests
get_address_tests
get_block_transactions_tests
get_blocks_tests
get_data_tests
get_headers_tests
# hash_number_tests
hash_tests
hd_private_tests
hd_public_tests
chain_header_tests
headers_tests
heading_tests
input_tests
inventory_tests
inventory_vector_tests
memory_pool_tests
merkle_block_tests
message_tests
mnemonic_tests
network_address_tests
not_found_tests
output_tests
parameter_tests
payment_address_tests
ping_tests
point_tests
pong_tests
prefilled_transaction_tests
printer_tests
pseudo_random_tests
reject_tests
# script_number_tests
script_tests
# send_compact_blocks_tests
send_headers_tests
serializer_tests
stealth_address_tests
stealth_tests
stream_tests
thread_tests
chain_transaction_tests
message_transaction_tests
unicode_istream_tests
unicode_ostream_tests
unicode_tests
uri_reader_tests
uri_tests
verack_tests
version_tests
transaction_functions_tests
)
if (WITH_PNG)
_add_tests(bitprim_core_test png_tests)
endif()
if (WITH_QRENCODE)
_add_tests(bitprim_core_test qrcode_tests)
endif()
endif()
if (WITH_TESTS_NEW)
if (WITH_KEOKEN)
add_executable(bitprim_core_test_new
test_new/main.cpp
test_new/create_transaction.cpp
)
target_link_libraries(bitprim_core_test_new PUBLIC bitprim-core)
add_test(NAME bitprim_core_test_new COMMAND bitprim_core_test_new)
endif()
endif()
# Examples
#==============================================================================
# local: examples/bitprim_core_examples
#------------------------------------------------------------------------------
if (WITH_EXAMPLES)
add_executable(bitprim_core_examples
examples/main.cpp)
target_link_libraries(bitprim_core_examples PUBLIC bitprim-core)
_group_sources(bitprim_core_examples "${CMAKE_CURRENT_LIST_DIR}/examples")
endif()
# Install
#==============================================================================
install(TARGETS bitprim-core EXPORT bitprim-core
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)
#install(EXPORT bitprim-coreTargets
#
#)
set(_bitprim_core_headers
bitcoin/bitcoin/multi_crypto_support.hpp
bitcoin/bitcoin/compat.h
bitcoin/bitcoin/compat.hpp
bitcoin/bitcoin/constants.hpp
bitcoin/bitcoin/define.hpp
bitcoin/bitcoin/error.hpp
bitcoin/bitcoin/handlers.hpp
bitcoin/bitcoin/version.hpp
bitcoin/bitcoin/chain/block.hpp
bitcoin/bitcoin/chain/chain_state.hpp
bitcoin/bitcoin/chain/compact.hpp
bitcoin/bitcoin/chain/header.hpp
bitcoin/bitcoin/chain/history.hpp
bitcoin/bitcoin/chain/input.hpp
bitcoin/bitcoin/chain/input_point.hpp
bitcoin/bitcoin/chain/output.hpp
bitcoin/bitcoin/chain/output_point.hpp
bitcoin/bitcoin/chain/point.hpp
bitcoin/bitcoin/chain/point_iterator.hpp
bitcoin/bitcoin/chain/point_value.hpp
bitcoin/bitcoin/chain/points_value.hpp
bitcoin/bitcoin/chain/script.hpp
bitcoin/bitcoin/chain/stealth.hpp
bitcoin/bitcoin/chain/transaction.hpp
bitcoin/bitcoin/chain/witness.hpp
bitcoin/bitcoin/machine/interpreter.hpp
bitcoin/bitcoin/machine/number.hpp
bitcoin/bitcoin/machine/opcode.hpp
bitcoin/bitcoin/machine/operation.hpp
bitcoin/bitcoin/machine/program.hpp
bitcoin/bitcoin/machine/rule_fork.hpp
bitcoin/bitcoin/machine/script_pattern.hpp
bitcoin/bitcoin/machine/sighash_algorithm.hpp
bitcoin/bitcoin/machine/script_version.hpp
bitcoin/bitcoin/config/authority.hpp
bitcoin/bitcoin/config/base16.hpp
bitcoin/bitcoin/config/base2.hpp
bitcoin/bitcoin/config/base58.hpp
bitcoin/bitcoin/config/base64.hpp
bitcoin/bitcoin/config/checkpoint.hpp
bitcoin/bitcoin/config/directory.hpp
bitcoin/bitcoin/config/endpoint.hpp
bitcoin/bitcoin/config/hash160.hpp
bitcoin/bitcoin/config/hash256.hpp
bitcoin/bitcoin/config/parameter.hpp
bitcoin/bitcoin/config/parser.hpp
bitcoin/bitcoin/config/printer.hpp
bitcoin/bitcoin/config/settings.hpp
bitcoin/bitcoin/config/sodium.hpp