-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
181 lines (170 loc) · 5.58 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
cmake_minimum_required(VERSION 3.24)
include(${CMAKE_CURRENT_BINARY_DIR}/local_conf.cmake OPTIONAL)
option(USE_QtQr "add qrCode types " ON)
option(USE_OMClient "add open-meteo types" ON)
option(USE_DateTimePickers "add datetimepickers types" ON)
option(USE_Iotaaccount "add iota account types" ON)
option(USE_Iotaconnection "add iota connection types" ON)
option(USE_QVault "add QVault types" ON)
include(FetchContent)
FetchContent_Declare(
ccommon
GIT_REPOSITORY https://github.com/EddyTheCo/Common.git
GIT_TAG v0.4.0)
FetchContent_MakeAvailable(ccommon)
version_from_git(LOG OFF TIMESTAMP "%Y%m%d%H%M%S")
project(
qmlonline
VERSION ${VERSION}
LANGUAGES CXX)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick Qml QuickControls2)
qt_standard_project_setup()
qt6_add_executable(appqmlonline main.cpp)
if(USE_QVault)
FetchContent_Declare(
QtVault
GIT_REPOSITORY https://github.com/EddyTheCo/QVault.git
GIT_TAG v0.2.1
FIND_PACKAGE_ARGS 0.2 CONFIG)
FetchContent_MakeAvailable(QtVault)
target_link_libraries(
appqmlonline
PRIVATE
QtVault::qvault
$<$<STREQUAL:$<TARGET_PROPERTY:QtVault::qvault,TYPE>,STATIC_LIBRARY>:QtVault::qvaultplugin>
)
list(APPEND qmlimport "Esterv.Utils.Vault")
endif(USE_QVault)
if(USE_OMClient)
FetchContent_Declare(
openMeteo
GIT_REPOSITORY https://github.com/EddyTheCo/OMClient.git
GIT_TAG v0.3.0
FIND_PACKAGE_ARGS 0.3 CONFIG)
FetchContent_MakeAvailable(openMeteo)
target_link_libraries(
appqmlonline
PRIVATE
openMeteo::OMClient
$<$<STREQUAL:$<TARGET_PROPERTY:openMeteo::OMClient,TYPE>,STATIC_LIBRARY>:openMeteo::OMClientplugin>
)
list(APPEND qmlimport Esterv.CustomControls.OpenMeteo)
endif(USE_OMClient)
if(USE_Iotaconnection)
FetchContent_Declare(
IotaNodeConn
GIT_REPOSITORY https://github.com/EddyTheCo/ConectionSettings.git
GIT_TAG v0.6.0
FIND_PACKAGE_ARGS 0.6 CONFIG)
FetchContent_MakeAvailable(IotaNodeConn)
target_link_libraries(
appqmlonline
PRIVATE
IotaNodeConn::nodeConnection
$<$<STREQUAL:$<TARGET_PROPERTY:IotaNodeConn::nodeConnection,TYPE>,STATIC_LIBRARY>:IotaNodeConn::nodeConnectionplugin>
)
list(APPEND qmlimport Esterv.Iota.NodeConnection)
endif(USE_Iotaconnection)
if(USE_Iotaaccount)
FetchContent_Declare(
IotaAccount
GIT_REPOSITORY https://github.com/EddyTheCo/account.git
GIT_TAG v0.7.0
FIND_PACKAGE_ARGS 0.7 CONFIG)
FetchContent_MakeAvailable(IotaAccount)
target_link_libraries(
appqmlonline
PRIVATE
IotaAccount::account
$<$<STREQUAL:$<TARGET_PROPERTY:IotaAccount::account,TYPE>,STATIC_LIBRARY>:IotaAccount::accountplugin>
)
list(APPEND qmlimport "Esterv.Iota.Account")
endif(USE_Iotaaccount)
if(USE_QtQr)
FetchContent_Declare(
qrCode
GIT_REPOSITORY https://github.com/EddyTheCo/qrCode.git
GIT_TAG v1.1.0
FIND_PACKAGE_ARGS 1.1 CONFIG)
FetchContent_MakeAvailable(qrCode)
target_link_libraries(
appqmlonline
PRIVATE
qrCode::QtQrGen
qrCode::QtQrDec
$<$<STREQUAL:$<TARGET_PROPERTY:qrCode::QtQrGen,TYPE>,STATIC_LIBRARY>:qrCode::QtQrGenplugin>
$<$<STREQUAL:$<TARGET_PROPERTY:qrCode::QtQrDec,TYPE>,STATIC_LIBRARY>:qrCode::QtQrDecplugin>
)
target_compile_definitions(appqmlonline PRIVATE USE_QtQr)
list(APPEND qmlimport "Esterv.CustomControls.QrGen"
"Esterv.CustomControls.QrDec")
endif(USE_QtQr)
if(USE_DateTimePickers)
FetchContent_Declare(
DTPickersQML
GIT_REPOSITORY https://github.com/EddyTheCo/DateTimePickers.git
GIT_TAG v0.2.1
FIND_PACKAGE_ARGS 0.2 CONFIG)
FetchContent_MakeAvailable(DTPickersQML)
target_link_libraries(
appqmlonline
PRIVATE
DTPickersQML::DTPickers
$<$<STREQUAL:$<TARGET_PROPERTY:DTPickersQML::DTPickers,TYPE>,STATIC_LIBRARY>:DTPickersQML::DTPickersplugin>
)
target_compile_definitions(appqmlonline PRIVATE USE_QtQr)
list(APPEND qmlimport "Esterv.CustomControls.DateTimePickers")
endif(USE_DateTimePickers)
FetchContent_Declare(
EstervDesigns
GIT_REPOSITORY https://github.com/EddyTheCo/MyDesigns.git
GIT_TAG v1.2.1
FIND_PACKAGE_ARGS 1.2 CONFIG)
FetchContent_MakeAvailable(EstervDesigns)
target_link_libraries(
appqmlonline
PRIVATE
EstervDesigns::SimpleStyle
EstervDesigns::CustomControls
EstervDesigns::FlatControl
$<$<STREQUAL:$<TARGET_PROPERTY:EstervDesigns::SimpleStyle,TYPE>,STATIC_LIBRARY>:EstervDesigns::SimpleStyleplugin>
$<$<STREQUAL:$<TARGET_PROPERTY:EstervDesigns::CustomControls,TYPE>,STATIC_LIBRARY>:EstervDesigns::CustomControlsplugin>
$<$<STREQUAL:$<TARGET_PROPERTY:EstervDesigns::FlatControl,TYPE>,STATIC_LIBRARY>:EstervDesigns::FlatControlplugin>
)
list(APPEND qmlimport "Esterv.Styles.Simple" "Esterv.CustomControls"
"Esterv.Controls.Flat")
qt6_add_qml_module(
appqmlonline
URI
qmlonline
VERSION
1.0
RESOURCE_PREFIX
"/esterVtech.com/imports"
QML_FILES
"main.qml"
SOURCES
"qmltextcode.cpp"
"qmltextcode.h"
IMPORT_PATH
${CMAKE_BINARY_DIR}
IMPORTS
${qmlimport})
target_link_libraries(appqmlonline PRIVATE Qt6::Core Qt6::Gui Qt6::Qml
Qt6::Quick Qt6::QuickControls2)
if(EMSCRIPTEN)
target_compile_definitions(appqmlonline PRIVATE USE_EMSCRIPTEN)
add_custom_command(
TARGET appqmlonline
POST_BUILD
COMMAND
${CMAKE_COMMAND} ARGS -E copy
"${CMAKE_CURRENT_BINARY_DIR}/appqmlonline.js"
"${CMAKE_CURRENT_BINARY_DIR}/appqmlonline.wasm"
"${CMAKE_CURRENT_BINARY_DIR}/qtloader.js"
"${CMAKE_CURRENT_SOURCE_DIR}/wasm")
endif()