-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
155 lines (118 loc) · 3.79 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
#
# Copyright (C) 2018-2021 QuasarApp.
# Distributed under the lgplv3 software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
cmake_minimum_required(VERSION 3.1)
project(HanoiTowers)
set(BUILD_SHARED_LIBS ON)
set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/HanoiTowers/client/android")
include(submodules/Heart/QuasarAppLib/CMake/QuasarApp.cmake)
include(submodules/Heart/QuasarAppLib/CMake/Version.cmake)
initAll()
if (DEFINED TARGET_PLATFORM_TOOLCHAIN)
if (${TARGET_PLATFORM_TOOLCHAIN} STREQUAL "wasm32")
return()
endif()
endif()
if (NOT DEFINED ONLINE_FUNCTIONS)
set(ONLINE_FUNCTIONS OFF)
endif()
if(ONLINE_FUNCTIONS)
add_definitions(-DONLINE_FUNCTIONS)
else()
set(HEART_SSL OFF)
endif()
if (NOT DEFINED HANOI_TESTS)
set(HANOI_TESTS ON)
if (ANDROID)
set(HANOI_TESTS OFF)
endif()
endif()
if (NOT DEFINED HANOI_ADMOD)
set(HANOI_ADMOD OFF)
if (ANDROID)
set(HANOI_ADMOD OFF)
endif()
endif()
if (HANOI_ADMOD)
add_definitions(-DHANOI_ADMOD)
endif()
if (NOT DEFINED HANOI_SERVER)
set(HANOI_SERVER OFF)
if (ANDROID OR WIN32)
set(HANOI_SERVER OFF)
endif()
if ( NOT ONLINE_FUNCTIONS)
set(HANOI_SERVER OFF)
endif()
endif()
if (NOT DEFINED HANOI_CLIENT)
set(HANOI_CLIENT ON)
endif()
SET(INSTALLER_DIR "${CMAKE_CURRENT_SOURCE_DIR}/installer/")
SET(DATA_DIR "${INSTALLER_DIR}/packages/HanoiTowers/data")
SET(TARGET_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Distro")
updateGitVars()
set(HANOI_TOWERS_SHORT_VERSION "1.${GIT_COMMIT_COUNT}")
set(HANOI_TOWERS_VERSION "${HANOI_TOWERS_SHORT_VERSION}.${GIT_COMMIT_HASH}")
file(MAKE_DIRECTORY ${TARGET_DIR})
addDoc(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
if(${QT_VERSION_MAJOR} GREATER 5)
message("This project not support qt6 libraries. Please use the qt5 libraries for building.")
return()
endif()
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
# Add sub directories
if (HANOI_TESTS)
set (CREDITS_TESTS ON)
set (HEART_TESTS ON)
set (PATRONUM_TESTS ON)
else()
set (CREDITS_TESTS OFF)
set (HEART_TESTS OFF)
set (PATRONUM_TESTS OFF)
endif()
option(HEART_SSL "This option enable or disabled ssl functions of nodes" OFF)
add_subdirectory(submodules/Heart)
add_subdirectory(HanoiTowers/Protockol)
if (HANOI_CLIENT)
set (CREDITS_EXAMPLES OFF)
set (LOGINVIEW_EXAMPLES OFF)
set (VIEWSOLUTIONS_EXAMPLES OFF)
add_subdirectory(submodules/QMLLoginView)
add_subdirectory(submodules/SimpleQmlNotify)
add_subdirectory(submodules/ViewSolutions)
add_subdirectory(submodules/Credits)
if (ANDROID)
if (HANOI_ADMOD)
set(QTAT_APP_PERMISSIONS OFF)
set(QTAT_APK_EXPANSION_FILES OFF)
set(QTAT_APK_INFO OFF)
set(QTAT_SCREEN OFF)
set(QTAT_SYSTEM OFF)
set(QTAT_BATTERY_STATE OFF)
set(QTAT_SIGNAL_STRENGTH OFF)
set(QTAT_IMAGES OFF)
set(QTAT_NOTIFICATION OFF)
set(QTAT_ADMOB_BANNER OFF)
set(QTAT_ADMOB_INTERSTITIAL ON)
set(QTAT_ADMOB_REWARDED_VIDEO OFF)
set(QTAT_PLAY_STORE OFF)
set(QTAT_GOOGLE_ACCOUNT OFF)
set(QTAT_GOOGLE_DRIVE OFF)
set(QTAT_SHARING OFF)
set(QTAT_USER_MESSAGING_PLATFORM OFF)
set(QTAT_AUDIO OFF)
add_subdirectory(submodules/QtAndroidTools/QtAndroidTools)
include_directories(submodules/QtAndroidTools/QtAndroidTools)
endif()
endif()
add_subdirectory(HanoiTowers/client)
endif()
if (HANOI_SERVER)
add_subdirectory(submodules/Patronum)
add_subdirectory(HanoiTowers/Server)
endif()