-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
132 lines (103 loc) · 5.06 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
cmake_minimum_required(VERSION 3.18)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include(project.metadata) ##> generate_dex_project_metafiles()
generate_dex_project_metafiles()
include(build_type)
include(compiler_prerequisites)
include(vcpkg_prerequisites)
include(qt_prerequisites)
include(cfg_hash)
project(${DEX_PROJECT_NAME} LANGUAGES CXX VERSION 0.8.1)
message(STATUS "${PROJECT_NAME} is version ${PROJECT_VERSION}")
include(cmake_default_options)
include(ipo_prerequisites)
##! Options
option(WITH_HOTRELOAD "Enable to use qml Hot reload" OFF)
if (NOT WITH_HOTRELOAD)
message(STATUS "Hot Reload is not active download SortFilterProxyModel")
include(FetchContent)
set(SFPM_REPOSITORY "https://github.com/OlivierLDff/SortFilterProxyModel.git" CACHE STRING "SortFilterProxyModel repository url")
set(SFPM_TAG master CACHE STRING "SortFilterProxyModel git tag")
FetchContent_Declare(
SortFilterProxyModel
GIT_REPOSITORY ${SFPM_REPOSITORY}
GIT_TAG ${SFPM_TAG}
GIT_SHALLOW 1
)
set(SFPM_FOLDER_PREFIX "Dependencies" CACHE STRING "Prefix folder for all SortFilterProxyModel generated targets in generated project (only decorative)")
FetchContent_MakeAvailable(SortFilterProxyModel)
endif()
##! Antara
include(antara)
##! Calling this macros provided by the sdk will if you are on Apple init the environment for this OS (std::filesystem).
init_antara_env()
##! We include the module from CMake for fetching dependencies
include(FetchContent)
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(LINUX TRUE)
endif ()
if (UNIX AND NOT APPLE)
message("Forcing stdlib C++")
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif ()
##! We fetch our dependencies
if (APPLE)
FetchContent_Declare(kdf
URL https://sdk.devbuilds.komodo.earth/dev/mm2_22719c0-mac-x86-64.zip)
elseif (UNIX AND NOT APPLE)
FetchContent_Declare(kdf
URL https://sdk.devbuilds.komodo.earth/dev/mm2_22719c0-linux-x86-64.zip)
else ()
FetchContent_Declare(kdf
URL https://sdk.devbuilds.komodo.earth/dev/mm2_22719c0-win-x86-64.zip)
endif ()
#FetchContent_Declare(qmaterial URL https://github.com/KomodoPlatform/Qaterial/archive/last-clang-working-2.zip)
FetchContent_Declare(
qmaterial
GIT_REPOSITORY https://github.com/KomodoPlatform/Qaterial.git
GIT_TAG 53669824261ae07bc0e8c2abb4b55431f65b2055
)
FetchContent_Declare(jl777-coins
URL https://github.com/KomodoPlatform/coins/archive/add/tendermint-coins.zip)
#FetchContent_Declare(adex-generics-coins
# URL https://github.com/KomodoPlatform/komodo-wallet-desktop/archive/main.zip)
FetchContent_MakeAvailable(kdf jl777-coins qmaterial)
##! Configure our needs.
if (UNIX)
configure_file(${jl777-coins_SOURCE_DIR}/utils/coins_config_tcp.json ${CMAKE_CURRENT_SOURCE_DIR}/assets/config/${PROJECT_VERSION}-coins.json COPYONLY)
configure_file(${jl777-coins_SOURCE_DIR}/coins ${CMAKE_CURRENT_SOURCE_DIR}/assets/tools/kdf/coins COPYONLY)
configure_file(${kdf_SOURCE_DIR}/mm2 ${CMAKE_CURRENT_SOURCE_DIR}/assets/tools/kdf/${DEX_API} COPYONLY)
file(COPY ${jl777-coins_SOURCE_DIR}/icons/ DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/atomic_defi_design/assets/images/coins/)
else ()
configure_file(${jl777-coins_SOURCE_DIR}/utils/coins_config_tcp.json ${CMAKE_BINARY_DIR}/bin/assets/config/${PROJECT_VERSION}-coins.json COPYONLY)
configure_file(${jl777-coins_SOURCE_DIR}/coins ${CMAKE_BINARY_DIR}/bin/assets/tools/kdf/coins COPYONLY)
configure_file(${kdf_SOURCE_DIR}/mm2.exe ${CMAKE_BINARY_DIR}/bin/assets/tools/kdf/${DEX_API}.exe COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ci_tools_atomic_dex/windows_misc/msvcp140.dll ${CMAKE_BINARY_DIR}/bin/assets/tools/kdf/msvcp140.dll COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ci_tools_atomic_dex/windows_misc/vcruntime140.dll ${CMAKE_BINARY_DIR}/bin/assets/tools/kdf/vcruntime140.dll COPYONLY)
endif ()
add_subdirectory(vendor/antara-gaming_sdk/modules)
##! Osx bundle icon
set(ICON)
configure_icon_osx(${CMAKE_CURRENT_SOURCE_DIR}/cmake/install/macos/dex-logo.icns ICON dex-logo.icns)
##! End antara
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
add_subdirectory(src)
# Adds Qaterial hot reload to main executable
if (WITH_HOTRELOAD)
FetchContent_Declare(
qaterial_hotreload
GIT_REPOSITORY https://github.com/KomodoPlatform/QaterialHotReload
GIT_TAG ecffec6bd01d9a13561689283bc2a6a927957f64
)
set(QATERIALHOTRELOAD_ENABLE_HOTRELOAD_APP OFF CACHE BOOL "")
FetchContent_MakeAvailable(qaterial_hotreload)
target_link_libraries(${PROJECT_NAME} PUBLIC Qaterial::HotReload)
target_compile_definitions(${PROJECT_NAME} PUBLIC ATOMICDEX_HOT_RELOAD)
endif ()
add_library(antara_qrcode STATIC)
target_sources(antara_qrcode PRIVATE vendor/qrcode/QrCode.cpp)
target_include_directories(antara_qrcode PUBLIC vendor/qrcode)
target_link_libraries(antara_qrcode PUBLIC antara::default_settings)