forked from DOMjudge/DOMjura
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
91 lines (80 loc) · 2.04 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
cmake_minimum_required(VERSION 3.16)
project(DOMjura VERSION 1.0 LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Automatically enable Qt features (UIC, MOC, etc.)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# Find Qt packages (Qt6 is preferred)
find_package(Qt6 REQUIRED COMPONENTS
Core
Gui
Network
OpenGL
OpenGLWidgets
Widgets
Xml
)
# Set up the project according to Qt standards
qt_standard_project_setup()
# Source files
set(SOURCES
aboutdialog.cpp aboutdialog.h aboutdialog.ui
contest.cpp contest.h
domjudgeapimanager.cpp domjudgeapimanager.h
gradientcache.cpp gradientcache.h
group.cpp group.h
headergraphicsitem.cpp headergraphicsitem.h
judging.cpp judging.h
legendagraphicsitem.cpp legendagraphicsitem.h
main.cpp
maincontroller.cpp maincontroller.h
maindialog.cpp maindialog.h maindialog.ui
problem.cpp problem.h
problemgraphicsitem.cpp problemgraphicsitem.h
rankedteam.cpp rankedteam.h
resultswindow.cpp resultswindow.h
settingsdialog.cpp settingsdialog.h settingsdialog.ui
standingscontroller.cpp standingscontroller.h
submission.cpp submission.h
team.cpp team.h
teamgraphicsitem.cpp teamgraphicsitem.h
winnergraphicsitem.cpp winnergraphicsitem.h
)
# Resources
set(RESOURCES
"resources/image-256.png"
)
# Add executable
qt_add_executable(DOMjura WIN32 MACOSX_BUNDLE
${SOURCES}
)
# Link with required Qt libraries
target_link_libraries(DOMjura PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Network
Qt6::OpenGL
Qt6::OpenGLWidgets
Qt6::Widgets
Qt6::Xml
)
# Add resources
qt_add_resources(DOMjura "resources"
PREFIX "/images"
FILES ${RESOURCES}
)
# Install targets
install(TARGETS DOMjura
BUNDLE DESTINATION .
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
# Deploy script generation for Qt
qt_generate_deploy_app_script(
TARGET DOMjura
OUTPUT_SCRIPT deploy_script
NO_UNSUPPORTED_PLATFORM_ERROR
)
# Install deploy script
install(SCRIPT ${deploy_script})