-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
121 lines (107 loc) · 3.29 KB
/
Copy pathCMakeLists.txt
File metadata and controls
121 lines (107 loc) · 3.29 KB
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
cmake_minimum_required(VERSION 3.22)
# Tests for the QML/Qt6 app
find_package(Qt 6.2 MODULE REQUIRED COMPONENTS Core Gui Network Test Qml Quick QuickTest Widgets)
add_executable(bitcoinqml_unit_tests
test_unit_tests_main.cpp
test_bitcoinaddress.cpp
test_blockclockdial.cpp
test_bitcoinuri.cpp
test_bitcoinamount.cpp
test_debuglogmodel.cpp
test_desktoptrayiconcontroller.cpp
test_desktopwindowbehaviormodel.cpp
test_peerlistmodel.cpp
test_peerstatsutil.cpp
test_psbtqmlmodel.cpp
test_walletqmlmodel.cpp
test_walletqmlmodeltransaction.cpp
test_qmlbitcoinunits.cpp
test_imageprovider.cpp
test_nodemodel.cpp
test_networkstyle.cpp
test_networkstatusmodel.cpp
test_networktraffictower.cpp
test_qmlinitexecutor_api.cpp
test_guiargs.cpp
test_options_model.cpp
test_onboarding_storage.cpp
test_banlistmodel.cpp
test_walletlistmodel.cpp
test_bumptransactionmodel.cpp
test_walletqmlcontroller.cpp
test_display_settings.cpp
test_addresslistmodel.cpp
test_receiverequesthistorymodel.cpp
test_transaction.cpp
test_activityfilterproxymodel.cpp
test_qtmessagefilter.cpp
test_rpccommandexecutor.cpp
test_rpcconsolemodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../bitcoin/src/util/chaintype.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../qml/models/bitcoinuri.cpp
)
target_compile_definitions(bitcoinqml_unit_tests
PRIVATE
BITCOINQML_NO_TEST_MAIN
)
target_include_directories(bitcoinqml_unit_tests
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_CURRENT_SOURCE_DIR}/../bitcoin/src
${CMAKE_CURRENT_SOURCE_DIR}/../bitcoin/src/univalue/include
${CMAKE_CURRENT_BINARY_DIR}/../bitcoin/src
)
target_link_libraries(bitcoinqml_unit_tests
PRIVATE
bitcoinqml
bitcoin_wallet
bitcoin_common
bitcoin_util
bitcoin_node
Qt6::Core
Qt6::Gui
Qt6::Quick
Qt6::Network
Qt6::Test
Qt6::Widgets
)
add_test(NAME bitcoinqml_unit_tests COMMAND bitcoinqml_unit_tests -platform minimal)
qt6_add_resources(QMLTESTS_QRC_CPP ${QML_QRC} qml/bitcoin_qmltests.qrc)
add_executable(bitcoinqml_qmltests
qml/qml_tests_main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../qml/components/blockclockdial.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../qml/controls/linegraph.cpp
${QMLTESTS_QRC_CPP}
)
target_compile_definitions(bitcoinqml_qmltests
PRIVATE
BITCOINQML_QML_SOURCE_DIR="qrc:/qml"
QUICK_TEST_SOURCE_DIR=":/test/qml"
BITCOINQML_QML_TEST_MOCKS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/mocks/qml"
)
target_link_libraries(bitcoinqml_qmltests
PRIVATE
Qt6::Core
Qt6::Qml
Qt6::Quick
Qt6::QuickTest
)
target_include_directories(bitcoinqml_qmltests
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/..
)
add_test(NAME bitcoinqml_qmltests COMMAND bitcoinqml_qmltests -platform minimal)
get_target_property(qt_lib_type Qt6::Core TYPE)
if(qt_lib_type STREQUAL "STATIC_LIBRARY")
qt6_import_plugins(bitcoinqml_unit_tests INCLUDE Qt6::QMinimalIntegrationPlugin)
qt6_import_plugins(bitcoinqml_qmltests INCLUDE Qt6::QMinimalIntegrationPlugin)
qt6_import_qml_plugins(bitcoinqml_qmltests)
target_link_libraries(bitcoinqml_qmltests PRIVATE
Qt6::qtquickdialogsplugin
)
if(Qt6_VERSION VERSION_GREATER_EQUAL 6.5)
target_link_libraries(bitcoinqml_qmltests PRIVATE Qt6::qtqmlcoreplugin)
else()
target_link_libraries(bitcoinqml_qmltests PRIVATE Qt6::qmlsettingsplugin)
endif()
endif()