2018-05-09 00:01:27 +00:00
|
|
|
add_subdirectory(QR-Code-scanner)
|
2020-04-06 16:57:32 +00:00
|
|
|
add_subdirectory(openpgp)
|
2021-07-11 00:03:46 +00:00
|
|
|
add_subdirectory(zxcvbn-c)
|
2018-05-09 00:01:27 +00:00
|
|
|
|
2020-07-09 15:13:21 +00:00
|
|
|
qt5_add_resources(RESOURCES ../qml.qrc)
|
2018-05-09 00:01:27 +00:00
|
|
|
|
|
|
|
# Compile source files (.h/.cpp)
|
|
|
|
file(GLOB SOURCE_FILES
|
|
|
|
"*.h"
|
|
|
|
"*.cpp"
|
|
|
|
"main/*.h"
|
|
|
|
"main/*.cpp"
|
|
|
|
"libwalletqt/WalletManager.cpp"
|
2020-04-11 10:43:21 +00:00
|
|
|
"libwalletqt/WalletListenerImpl.cpp"
|
2018-05-09 00:01:27 +00:00
|
|
|
"libwalletqt/Wallet.cpp"
|
2020-04-11 10:43:21 +00:00
|
|
|
"libwalletqt/PassphraseHelper.cpp"
|
2018-05-09 00:01:27 +00:00
|
|
|
"libwalletqt/PendingTransaction.cpp"
|
|
|
|
"libwalletqt/TransactionHistory.cpp"
|
|
|
|
"libwalletqt/TransactionInfo.cpp"
|
2021-04-08 23:10:04 +00:00
|
|
|
"libwalletqt/QRCodeImageProvider.cpp"
|
2018-05-09 00:01:27 +00:00
|
|
|
"libwalletqt/AddressBook.cpp"
|
|
|
|
"libwalletqt/Subaddress.cpp"
|
|
|
|
"libwalletqt/SubaddressAccount.cpp"
|
|
|
|
"libwalletqt/UnsignedTransaction.cpp"
|
|
|
|
"libwalletqt/WalletManager.h"
|
|
|
|
"libwalletqt/Wallet.h"
|
2020-04-11 10:43:21 +00:00
|
|
|
"libwalletqt/PassphraseHelper.h"
|
2018-05-09 00:01:27 +00:00
|
|
|
"libwalletqt/PendingTransaction.h"
|
|
|
|
"libwalletqt/TransactionHistory.h"
|
|
|
|
"libwalletqt/TransactionInfo.h"
|
|
|
|
"libwalletqt/QRCodeImageProvider.h"
|
|
|
|
"libwalletqt/Transfer.h"
|
|
|
|
"libwalletqt/AddressBook.h"
|
|
|
|
"libwalletqt/Subaddress.h"
|
|
|
|
"libwalletqt/SubaddressAccount.h"
|
|
|
|
"libwalletqt/UnsignedTransaction.h"
|
2020-07-07 23:04:47 +00:00
|
|
|
"daemon/*.h"
|
|
|
|
"daemon/*.cpp"
|
2022-04-01 17:27:35 +00:00
|
|
|
"p2pool/*.h"
|
|
|
|
"p2pool/*.cpp"
|
2020-07-07 23:04:47 +00:00
|
|
|
"model/*.h"
|
|
|
|
"model/*.cpp"
|
|
|
|
"qt/*.h"
|
2018-05-09 00:01:27 +00:00
|
|
|
"qt/*.cpp"
|
|
|
|
)
|
2020-07-07 23:04:47 +00:00
|
|
|
if(APPLE)
|
|
|
|
list(APPEND SOURCE_FILES "qt/macoshelper.mm")
|
|
|
|
endif()
|
2018-05-09 00:01:27 +00:00
|
|
|
|
2019-10-08 11:42:52 +00:00
|
|
|
set(EXECUTABLE_FLAG)
|
|
|
|
if(MINGW)
|
|
|
|
set(EXECUTABLE_FLAG WIN32)
|
2019-12-20 13:27:47 +00:00
|
|
|
|
|
|
|
set(ICON ${PROJECT_SOURCE_DIR}/images/appicon.ico)
|
|
|
|
set(ICON_RC ${CMAKE_CURRENT_BINARY_DIR}/icon.rc)
|
|
|
|
set(ICON_RES ${CMAKE_CURRENT_BINARY_DIR}/icon.o)
|
|
|
|
file(WRITE ${ICON_RC} "IDI_ICON1 ICON DISCARDABLE \"${ICON}\"")
|
2020-09-10 10:37:06 +00:00
|
|
|
find_program(Qt5_WINDRES_EXECUTABLE NAMES windres x86_64-w64-mingw32-windres REQUIRED CMAKE_FIND_ROOT_PATH_BOTH)
|
|
|
|
add_custom_command(OUTPUT ${ICON_RES} COMMAND ${Qt5_WINDRES_EXECUTABLE} ${ICON_RC} ${ICON_RES} MAIN_DEPENDENCY ${ICON_RC})
|
2019-12-20 13:27:47 +00:00
|
|
|
list(APPEND RESOURCES ${ICON_RES})
|
2019-10-08 11:42:52 +00:00
|
|
|
endif()
|
|
|
|
|
2020-07-09 06:11:54 +00:00
|
|
|
if(APPLE)
|
|
|
|
set(ICON ${PROJECT_SOURCE_DIR}/images/appicon.icns)
|
|
|
|
set_source_files_properties(${ICON} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
|
|
|
|
list(APPEND RESOURCES ${ICON})
|
|
|
|
endif()
|
|
|
|
|
2020-10-21 16:19:26 +00:00
|
|
|
set(monero_wallet_gui_sources
|
2019-10-02 15:11:59 +00:00
|
|
|
${SOURCE_FILES}
|
2019-12-20 13:27:47 +00:00
|
|
|
${RESOURCES}
|
2019-10-02 15:11:59 +00:00
|
|
|
)
|
2020-07-09 06:11:54 +00:00
|
|
|
|
2020-10-21 16:19:26 +00:00
|
|
|
if(NOT ANDROID)
|
|
|
|
add_executable(monero-wallet-gui ${EXECUTABLE_FLAG} ${monero_wallet_gui_sources})
|
|
|
|
else()
|
|
|
|
add_library(monero-wallet-gui SHARED ${monero_wallet_gui_sources})
|
|
|
|
set_target_properties(monero-wallet-gui PROPERTIES COMPILE_DEFINITIONS "ANDROID")
|
|
|
|
endif()
|
|
|
|
|
2020-07-09 06:11:54 +00:00
|
|
|
set_target_properties(monero-wallet-gui PROPERTIES
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
|
|
|
|
MACOSX_BUNDLE TRUE
|
|
|
|
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/share/Info.plist"
|
|
|
|
)
|
2018-05-09 00:01:27 +00:00
|
|
|
|
|
|
|
# OpenGL
|
2020-05-13 14:26:14 +00:00
|
|
|
target_include_directories(monero-wallet-gui PUBLIC ${OPENGL_INCLUDE_DIR})
|
2018-05-09 00:01:27 +00:00
|
|
|
message(STATUS "OpenGL: include dir at ${OPENGL_INCLUDE_DIR}")
|
|
|
|
message(STATUS "OpenGL: libraries at ${OPENGL_LIBRARIES}")
|
|
|
|
|
2020-05-13 14:26:14 +00:00
|
|
|
target_include_directories(monero-wallet-gui PUBLIC ${Qt5Gui_PRIVATE_INCLUDE_DIRS})
|
2018-05-09 00:01:27 +00:00
|
|
|
|
2020-05-13 14:26:14 +00:00
|
|
|
target_include_directories(monero-wallet-gui PUBLIC
|
2018-05-09 00:01:27 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/monero/include
|
|
|
|
${CMAKE_SOURCE_DIR}/monero/src
|
2020-03-08 15:30:34 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/monero/external/easylogging++
|
|
|
|
${CMAKE_SOURCE_DIR}/monero/contrib/epee/include
|
2020-09-24 23:37:29 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/monero/external/qrcodegen
|
2018-05-09 00:01:27 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/daemon
|
2022-04-01 17:27:35 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/p2pool
|
2018-05-09 00:01:27 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/libwalletqt
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/model
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/QR-Code-scanner
|
2019-10-02 15:11:59 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/zxcvbn-c
|
2018-05-09 00:01:27 +00:00
|
|
|
${X11_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
|
2020-05-13 14:26:14 +00:00
|
|
|
target_compile_definitions(monero-wallet-gui
|
2018-05-09 00:01:27 +00:00
|
|
|
PUBLIC
|
|
|
|
${Qt5Widgets_DEFINITIONS}
|
|
|
|
${Qt5Qml_DEFINITIONS}
|
|
|
|
)
|
|
|
|
|
2020-12-20 20:00:23 +00:00
|
|
|
if(APPLE)
|
|
|
|
if(NOT ICU_ROOT)
|
|
|
|
execute_process(COMMAND brew --prefix icu4c OUTPUT_VARIABLE ICU_ROOT OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
endif()
|
|
|
|
find_package(ICU REQUIRED COMPONENTS data i18n uc)
|
|
|
|
target_link_directories(monero-wallet-gui PRIVATE ${ICU_ROOT}/lib)
|
|
|
|
endif()
|
|
|
|
|
2019-11-29 10:09:00 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
|
2018-05-09 00:01:27 +00:00
|
|
|
|
2020-05-13 14:26:14 +00:00
|
|
|
target_link_libraries(monero-wallet-gui
|
2020-07-02 23:09:59 +00:00
|
|
|
epee
|
2021-05-10 21:35:40 +00:00
|
|
|
common
|
|
|
|
net
|
2021-04-27 10:33:11 +00:00
|
|
|
wallet_api
|
2020-09-24 23:37:29 +00:00
|
|
|
qrcodegen
|
2020-07-02 23:09:59 +00:00
|
|
|
easylogging
|
2019-10-07 12:07:09 +00:00
|
|
|
${QT5_LIBRARIES}
|
|
|
|
${EXTRA_LIBRARIES}
|
2020-04-06 16:57:32 +00:00
|
|
|
openpgp
|
2020-12-21 19:58:27 +00:00
|
|
|
qrdecoder
|
2020-07-09 15:13:21 +00:00
|
|
|
translations
|
2021-06-14 17:13:32 +00:00
|
|
|
zxcvbn
|
2018-05-09 00:01:27 +00:00
|
|
|
)
|
|
|
|
|
2020-06-19 21:50:42 +00:00
|
|
|
if(X11_FOUND)
|
|
|
|
target_link_libraries(monero-wallet-gui ${X11_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
2018-05-09 00:01:27 +00:00
|
|
|
if(WITH_SCANNER)
|
2020-12-21 19:58:27 +00:00
|
|
|
target_link_libraries(monero-wallet-gui qrscanner)
|
|
|
|
if(LINUX AND NOT ANDROID)
|
2020-10-21 16:19:26 +00:00
|
|
|
target_link_libraries(monero-wallet-gui
|
|
|
|
jpeg
|
|
|
|
v4l2
|
|
|
|
v4lconvert
|
|
|
|
rt
|
|
|
|
)
|
|
|
|
endif()
|
2018-05-09 00:01:27 +00:00
|
|
|
endif()
|
|
|
|
|
2020-08-28 22:41:03 +00:00
|
|
|
add_custom_command(TARGET monero-wallet-gui POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:daemon> $<TARGET_FILE_DIR:monero-wallet-gui>)
|
|
|
|
|
2020-09-22 12:38:52 +00:00
|
|
|
include(Deploy)
|
|
|
|
|
2020-05-13 14:26:14 +00:00
|
|
|
install(TARGETS monero-wallet-gui
|
2020-10-17 21:49:17 +00:00
|
|
|
DESTINATION bin
|
2018-05-09 00:01:27 +00:00
|
|
|
)
|