|
1 | 1 | add_subdirectory(QR-Code-scanner) |
2 | 2 | add_subdirectory(openpgp) |
3 | 3 | add_subdirectory(zxcvbn-c) |
4 | | - |
5 | | -qt5_add_resources(RESOURCES ../qml.qrc) |
6 | | - |
7 | | -# Compile source files (.h/.cpp) |
8 | | -file(GLOB SOURCE_FILES |
9 | | - "*.h" |
10 | | - "*.cpp" |
11 | | - "main/*.h" |
12 | | - "main/*.cpp" |
13 | | - "libwalletqt/WalletManager.cpp" |
14 | | - "libwalletqt/WalletListenerImpl.cpp" |
15 | | - "libwalletqt/Wallet.cpp" |
16 | | - "libwalletqt/PassphraseHelper.cpp" |
17 | | - "libwalletqt/PendingTransaction.cpp" |
18 | | - "libwalletqt/TransactionHistory.cpp" |
19 | | - "libwalletqt/TransactionInfo.cpp" |
20 | | - "libwalletqt/QRCodeImageProvider.cpp" |
21 | | - "libwalletqt/AddressBook.cpp" |
22 | | - "libwalletqt/Subaddress.cpp" |
23 | | - "libwalletqt/SubaddressAccount.cpp" |
24 | | - "libwalletqt/UnsignedTransaction.cpp" |
25 | | - "libwalletqt/WalletManager.h" |
26 | | - "libwalletqt/Wallet.h" |
27 | | - "libwalletqt/PassphraseHelper.h" |
28 | | - "libwalletqt/PendingTransaction.h" |
29 | | - "libwalletqt/TransactionHistory.h" |
30 | | - "libwalletqt/TransactionInfo.h" |
31 | | - "libwalletqt/QRCodeImageProvider.h" |
32 | | - "libwalletqt/Transfer.h" |
33 | | - "libwalletqt/AddressBook.h" |
34 | | - "libwalletqt/Subaddress.h" |
35 | | - "libwalletqt/SubaddressAccount.h" |
36 | | - "libwalletqt/UnsignedTransaction.h" |
37 | | - "daemon/*.h" |
38 | | - "daemon/*.cpp" |
39 | | - "model/*.h" |
40 | | - "model/*.cpp" |
41 | | - "qt/*.h" |
42 | | - "qt/*.cpp" |
43 | | -) |
44 | | -if(APPLE) |
45 | | - list(APPEND SOURCE_FILES "qt/macoshelper.mm") |
46 | | -endif() |
47 | | - |
48 | | -set(EXECUTABLE_FLAG) |
49 | | -if(MINGW) |
50 | | - set(EXECUTABLE_FLAG WIN32) |
51 | | - |
52 | | - set(ICON ${PROJECT_SOURCE_DIR}/images/appicon.ico) |
53 | | - set(ICON_RC ${CMAKE_CURRENT_BINARY_DIR}/icon.rc) |
54 | | - set(ICON_RES ${CMAKE_CURRENT_BINARY_DIR}/icon.o) |
55 | | - file(WRITE ${ICON_RC} "IDI_ICON1 ICON DISCARDABLE \"${ICON}\"") |
56 | | - find_program(Qt5_WINDRES_EXECUTABLE NAMES windres x86_64-w64-mingw32-windres REQUIRED CMAKE_FIND_ROOT_PATH_BOTH) |
57 | | - add_custom_command(OUTPUT ${ICON_RES} COMMAND ${Qt5_WINDRES_EXECUTABLE} ${ICON_RC} ${ICON_RES} MAIN_DEPENDENCY ${ICON_RC}) |
58 | | - list(APPEND RESOURCES ${ICON_RES}) |
59 | | -endif() |
60 | | - |
61 | | -if(APPLE) |
62 | | - set(ICON ${PROJECT_SOURCE_DIR}/images/appicon.icns) |
63 | | - set_source_files_properties(${ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") |
64 | | - list(APPEND RESOURCES ${ICON}) |
65 | | -endif() |
66 | | - |
67 | | -set(monero_wallet_gui_sources |
68 | | - ${SOURCE_FILES} |
69 | | - ${RESOURCES} |
70 | | -) |
71 | | - |
72 | | -if(NOT ANDROID) |
73 | | - add_executable(monero-wallet-gui ${EXECUTABLE_FLAG} ${monero_wallet_gui_sources}) |
74 | | -else() |
75 | | - add_library(monero-wallet-gui SHARED ${monero_wallet_gui_sources}) |
76 | | - set_target_properties(monero-wallet-gui PROPERTIES COMPILE_DEFINITIONS "ANDROID") |
77 | | -endif() |
78 | | - |
79 | | -set_target_properties(monero-wallet-gui PROPERTIES |
80 | | - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" |
81 | | - MACOSX_BUNDLE TRUE |
82 | | - MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/share/Info.plist" |
83 | | -) |
84 | | - |
85 | | -# OpenGL |
86 | | -target_include_directories(monero-wallet-gui PUBLIC ${OPENGL_INCLUDE_DIR}) |
87 | | -message(STATUS "OpenGL: include dir at ${OPENGL_INCLUDE_DIR}") |
88 | | -message(STATUS "OpenGL: libraries at ${OPENGL_LIBRARIES}") |
89 | | - |
90 | | -target_include_directories(monero-wallet-gui PUBLIC ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) |
91 | | - |
92 | | -target_include_directories(monero-wallet-gui PUBLIC |
93 | | - ${CMAKE_SOURCE_DIR}/monero/include |
94 | | - ${CMAKE_SOURCE_DIR}/monero/src |
95 | | - ${CMAKE_SOURCE_DIR}/monero/external/easylogging++ |
96 | | - ${CMAKE_SOURCE_DIR}/monero/contrib/epee/include |
97 | | - ${CMAKE_SOURCE_DIR}/monero/external/qrcodegen |
98 | | - ${CMAKE_CURRENT_SOURCE_DIR} |
99 | | - ${CMAKE_CURRENT_SOURCE_DIR}/daemon |
100 | | - ${CMAKE_CURRENT_SOURCE_DIR}/libwalletqt |
101 | | - ${CMAKE_CURRENT_SOURCE_DIR}/model |
102 | | - ${CMAKE_CURRENT_SOURCE_DIR}/QR-Code-scanner |
103 | | - ${CMAKE_CURRENT_SOURCE_DIR}/zxcvbn-c |
104 | | - ${X11_INCLUDE_DIR} |
105 | | -) |
106 | | - |
107 | | -target_compile_definitions(monero-wallet-gui |
108 | | - PUBLIC |
109 | | - ${Qt5Widgets_DEFINITIONS} |
110 | | - ${Qt5Qml_DEFINITIONS} |
111 | | -) |
112 | | - |
113 | | -if(APPLE) |
114 | | - if(NOT ICU_ROOT) |
115 | | - execute_process(COMMAND brew --prefix icu4c OUTPUT_VARIABLE ICU_ROOT OUTPUT_STRIP_TRAILING_WHITESPACE) |
116 | | - endif() |
117 | | - find_package(ICU REQUIRED COMPONENTS data i18n uc) |
118 | | - target_link_directories(monero-wallet-gui PRIVATE ${ICU_ROOT}/lib) |
119 | | -endif() |
120 | | - |
121 | | -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") |
122 | | - |
123 | | -target_link_libraries(monero-wallet-gui |
124 | | - epee |
125 | | - common |
126 | | - net |
127 | | - wallet_api |
128 | | - qrcodegen |
129 | | - easylogging |
130 | | - ${QT5_LIBRARIES} |
131 | | - ${EXTRA_LIBRARIES} |
132 | | - openpgp |
133 | | - qrdecoder |
134 | | - translations |
135 | | - zxcvbn |
136 | | -) |
137 | | - |
138 | | -if(X11_FOUND) |
139 | | - target_link_libraries(monero-wallet-gui ${X11_LIBRARIES}) |
140 | | -endif() |
141 | | - |
142 | | -if(WITH_SCANNER) |
143 | | - target_link_libraries(monero-wallet-gui qrscanner) |
144 | | - if(LINUX AND NOT ANDROID) |
145 | | - target_link_libraries(monero-wallet-gui |
146 | | - jpeg |
147 | | - v4l2 |
148 | | - v4lconvert |
149 | | - rt |
150 | | - ) |
151 | | - endif() |
152 | | -endif() |
153 | | - |
154 | | -add_custom_command(TARGET monero-wallet-gui POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:daemon> $<TARGET_FILE_DIR:monero-wallet-gui>) |
155 | | - |
156 | | -include(Deploy) |
157 | | - |
158 | | -install(TARGETS monero-wallet-gui |
159 | | - DESTINATION bin |
160 | | -) |
| 4 | +add_subdirectory(libwalletqt) |
| 5 | +add_subdirectory(main) |
0 commit comments