-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
191 lines (169 loc) · 7.54 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
182
183
184
185
186
187
188
189
190
191
cmake_minimum_required(VERSION 3.21.1)
option(LINK_INSIGHT "Link Qt Insight Tracker library" ON)
option(BUILD_QDS_COMPONENTS "Build design studio components" OFF)
project(StudentManagementApp LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(QT_VERSION_MAJOR 6)
find_package(Qt${QT_VERSION_MAJOR} 6.7 COMPONENTS Core Gui Qml Quick Widgets REQUIRED)
qt_policy(SET QTP0001 NEW)
message("Qt major version: ${QT_VERSION_MAJOR}")
if (Qt6_VERSION VERSION_GREATER_EQUAL 6.3)
qt_standard_project_setup()
endif()
qt_add_executable(StudentManagementApp
src/main.cpp
src/Models/Commons/student.h
src/Models/Commons/student.cpp
src/Models/Commons/studentvalidator.h
src/Models/Commons/studentvalidator.cpp
src/Models/Commons/comparefunctions.cpp
src/Models/Commons/comparefunctions.h
src/Utils/appenviroment.h
src/Utils/appenviroment.cpp
src/Models/mainwindowcontroller.h
src/Models/mainwindowcontroller.cpp
src/Utils/xlsxproxy.h
src/Utils/xlsxproxy.cpp
src/Models/Commons/storagedstructureselections.cpp
src/Models/Commons/storagedstructureselections.h
src/Models/Commons/sortedmethodselections.cpp
src/Models/Commons/sortedmethodselections.h
src/Models/Overview/overviewcontroller.cpp
src/Models/Overview/overviewcontroller.h
src/Models/Overview/clisttablemodel.cpp
src/Models/Overview/clisttablemodel.h
src/Models/Overview/dlisttablemodel.cpp
src/Models/Overview/dlisttablemodel.h
src/Models/Overview/slisttablemodel.cpp
src/Models/Overview/slisttablemodel.h
src/Models/Overview/sortfiltertablemodel.cpp
src/Models/Overview/sortfiltertablemodel.h
src/Models/Overview/vectortablemodel.cpp
src/Models/Overview/vectortablemodel.h
src/Models/Overview/datatableprovider.cpp
src/Models/Overview/datatableprovider.h
src/Models/Statistics/statisticscontroller.h
src/Models/Statistics/statisticscontroller.cpp
src/Models/Statistics/highestscoreslistview.h
src/Models/Statistics/highestscoreslistview.cpp
src/Models/Statistics/lowestscoreslistview.h
src/Models/Statistics/lowestscoreslistview.cpp
src/Models/Statistics/highestscoreslist.h
src/Models/Statistics/highestscoreslist.cpp
src/Models/Statistics/lowestscoreslist.h
src/Models/Statistics/lowestscoreslist.cpp
applicationresource.qrc
)
if(WIN32)
set_target_properties(StudentManagementApp PROPERTIES WIN32_EXECUTABLE TRUE)
endif()
qt_add_resources(StudentManagementApp "configuration"
PREFIX "/"
FILES
qtquickcontrols2.conf
)
target_link_libraries(StudentManagementApp PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Qml
Qt6::Quick
Qt6::Widgets
)
add_subdirectory(DSALibraries)
add_subdirectory(QXlsx/QXlsx/)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/Models ${CMAKE_CURRENT_SOURCE_DIR}/src/Utils ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Statistics
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview ${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons ${CMAKE_CURRENT_SOURCE_DIR}/DSALibraries ${CMAKE_CURRENT_SOURCE_DIR}/QXlsx/QXlsx/header)
set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml)
set(QML_IMPORT_PATH ${QT_QML_OUTPUT_DIRECTORY}
CACHE STRING "Import paths for Qt Creator's code model"
FORCE
)
qt_add_qml_module(OverviewController
URI "OverviewController"
VERSION 1.0
RESOURCE_PREFIX "/qt/qml"
SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/overviewcontroller.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/overviewcontroller.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/clisttablemodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/clisttablemodel.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/dlisttablemodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/dlisttablemodel.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/slisttablemodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/slisttablemodel.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/sortfiltertablemodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/sortfiltertablemodel.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/vectortablemodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/vectortablemodel.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/datatableprovider.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Overview/datatableprovider.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/student.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/student.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/studentvalidator.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/studentvalidator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/comparefunctions.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/comparefunctions.h
STATIC
)
qt_add_qml_module(MainWindowController
URI "MainWindowController"
VERSION 1.0
RESOURCE_PREFIX "/qt/qml"
SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/mainwindowcontroller.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/mainwindowcontroller.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/student.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/student.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/studentvalidator.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/studentvalidator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Utils/xlsxproxy.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Utils/xlsxproxy.cpp
STATIC
)
qt_add_qml_module(StatisticsController
URI "StatisticsController"
VERSION 1.0
RESOURCE_PREFIX "/qt/qml"
SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Statistics/statisticscontroller.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Statistics/statisticscontroller.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Statistics/highestscoreslistview.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Statistics/highestscoreslistview.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Statistics/lowestscoreslistview.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Statistics/lowestscoreslistview.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Statistics/highestscoreslist.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Statistics/highestscoreslist.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Statistics/lowestscoreslist.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Statistics/lowestscoreslist.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/student.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/student.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/studentvalidator.h
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/studentvalidator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/comparefunctions.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/Models/Commons/comparefunctions.h
STATIC
)
target_link_libraries(StudentManagementApp PRIVATE DSALibraries QXlsx::QXlsx OverviewControllerplugin MainWindowControllerplugin StatisticsControllerplugin )
if (BUILD_QDS_COMPONENTS)
include(${CMAKE_CURRENT_SOURCE_DIR}/qmlcomponents)
endif()
include(${CMAKE_CURRENT_SOURCE_DIR}/qmlmodules)
if (LINK_INSIGHT)
include(${CMAKE_CURRENT_SOURCE_DIR}/insight)
endif ()
include(GNUInstallDirs)
install(TARGETS StudentManagementApp
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# qt_generate_deploy_qml_app_script(
# TARGET StudentManagementApp
# OUTPUT_SCRIPT deploy_qml
# )
# install(SCRIPT ${deploy_qml})
# make IDEs aware of the QML import path
set(QML_IMPORT_PATH ${PROJECT_BINARY_DIR}/qml CACHE PATH
"Path to the custom QML components defined by the project")