/
CMakeLists.txt
127 lines (112 loc) · 3.5 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
cmake_minimum_required(VERSION 2.8.11)
project(QTournament)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
# Find the QtWidgets library
find_package(Qt5Widgets)
find_package(Qt5Core)
# Executables fail to build with Qt 5 in the default configuration
# without -fPIE. We add that here.
#set(CMAKE_CXX_FLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
# Include the header of the database overlay lib
include_directories("../DatabaseOverlayLib")
link_directories("../DatabaseOverlayLib")
include_directories("../SimpleReportGeneratorLib")
link_directories("../SimpleReportGeneratorLib")
# Enable support for C++ 11
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(QTournament_Sources
ui/GuiHelpers.cpp
tournament.qrc
BracketGenerator.cpp
Category.cpp
CatMngr.cpp
CatRoundStatus.cpp
Court.cpp
CourtMngr.cpp
GenericDatabaseObject.cpp
GenericObjectManager.cpp
GroupDef.cpp
KO_Config.cpp
MatchGroup.cpp
MatchMngr.cpp
Match.cpp
Player.cpp
PlayerMngr.cpp
PlayerPair.cpp
RankingEntry.cpp
RankingMngr.cpp
RoundRobinCategory.cpp
RoundRobinGenerator.cpp
Score.cpp
Team.cpp
TeamMngr.cpp
ThreadSafeQueue.cpp
Tournament.cpp
TournamentDB.cpp
models/CatTableModel.cpp
models/MatchGroupTabModel.cpp
models/PlayerTableModel.cpp
models/CourtTabModel.cpp
models/MatchTabModel.cpp
models/TeamListModel.cpp
reports/AbstractReport.cpp
reports/MatchResultList.cpp
reports/MatchResultList_byGroup.cpp
reports/ParticipantsList.cpp
reports/ReportFactory.cpp
reports/Standings.cpp)
set(QTournament_Sources_UI
ui/CatTableView.cpp
ui/CatTabWidget.cpp
ui/CourtTableView.cpp
ui/dlgEditPlayer.cpp
ui/dlgGroupAssignment.cpp
ui/GroupAssignmentListWidget.cpp
ui/GroupConfigWidget.cpp
ui/MainFrame.cpp
ui/MatchGroupTableView.cpp
ui/MatchTableView.cpp
ui/PlayerTableView.cpp
ui/PlayerTabWidget.cpp
ui/ReportsTabWidget.cpp
ui/ScheduleTabWidget.cpp
ui/TeamListView.cpp
ui/TeamTabWidget.cpp
ui/delegates/CatItemDelegate.cpp
ui/delegates/CourtItemDelegate.cpp
ui/delegates/DelegateItemLED.cpp
ui/delegates/MatchItemDelegate.cpp
ui/delegates/PairItemDelegate.cpp
ui/delegates/PlayerItemDelegate.cpp)
set(QTournament_Tests
tests/BasicTestClass.cpp
tests/tstBracketGenerator.cpp
tests/tstGenericDBObject.cpp
tests/tstPlayer.cpp
tests/tstTournament.cpp
tests/DatabaseTestScenario.cpp
tests/tstGroupDef.cpp
tests/tstPlayerMngr.cpp
tests/tstRoundRobinGenerator.cpp
tests/tstCategory.cpp
tests/tstKOConfig.cpp
tests/tstScore.cpp
tests/tstTeam.cpp
tests/tstMatch.cpp
tests/tstCatMngr.cpp
tests/tstMatchMngr.cpp
tests/tstRankingMngr.cpp
tests/tstTeamMngr.cpp)
add_executable(QTournament main.cpp ${QTournament_Sources} ${QTournament_Sources_UI})
add_executable(QTournament_Tests EXCLUDE_FROM_ALL tests/unitTestMain.cpp ${QTournament_Sources} ${QTournament_Tests})
qt5_use_modules(QTournament Widgets Sql)
qt5_use_modules(QTournament_Tests Widgets Sql)
# Use the Widgets module from Qt 5.
#target_link_libraries(helloworld Qt5::Widgets)
target_link_libraries(QTournament DatabaseOverlayLib SimpleReportGenerator)
target_link_libraries(QTournament_Tests DatabaseOverlayLib cppunit SimpleReportGenerator)