-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·158 lines (130 loc) · 3.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
set (PROJECT_OUTPUT_NAME uu)
project(UU)
cmake_minimum_required( VERSION 2.6 )
INCLUDE(FindQt4)
find_package( Qt4 REQUIRED )
SET(QT_USE_QTXML 1)
SET(QT_USE_QTNETWORK 1)
include( ${QT_USE_FILE})
SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package( QtSingleApplication REQUIRED )
include_directories(${QTSINGLEAPPLICATION_INCLUDE_DIR})
add_definitions(-DUNICODE)
include_directories(
src
src/core
src/gui
src/utils
${CMAKE_CURRENT_BINARY_DIR}
)
################################################################
# src
################################################################
set (src_SRC
src/main.cpp
)
set (src_HEADERS
)
################################################################
# src/utils
################################################################
set (src_utils_SRC
src/utils/widgetstatesettings.cpp
)
set (src_utils_HEADERS
)
################################################################
# src/core
################################################################
set (src_core_SRC
src/core/core.cpp
src/core/defaultversionnumbering.cpp
src/core/productversion.cpp
src/core/abstractupdateconfig.cpp
src/core/abstractupdater.cpp
src/core/updateconfigfactory.cpp
src/core/xmlupdateconfig.cpp
src/core/webupdater.cpp
src/core/updaterfactory.cpp
src/core/updateschecker.cpp
src/core/configloader.cpp
src/core/settingschangechecker.cpp
src/core/updatesmodel.cpp
)
set (src_core_HEADERS
src/core/abstractupdater.h
src/core/webupdater.h
src/core/updateschecker.h
src/core/configloader.h
src/core/settingschangechecker_p.h
src/core/settingschangechecker.h
src/core/updatesmodel.h
)
################################################################
# src/gui
################################################################
set (src_gui_SRC
src/gui/mainwindow.cpp
src/gui/updaterwidget.cpp
src/gui/updatepreferencewidget.cpp
src/gui/preferencesdialog.cpp
src/gui/updatedownloaddialog.cpp
)
set (src_gui_HEADERS
src/gui/mainwindow.h
src/gui/updaterwidget.h
src/gui/abstractpreferencewidget.h
src/gui/updatepreferencewidget.h
src/gui/preferencesdialog.h
src/gui/updatedownloaddialog.h
)
set (src_gui_UI
src/gui/mainwindow.ui
src/gui/updaterwidget.ui
src/gui/updatepreferencewidget.ui
src/gui/preferencesdialog.ui
src/gui/updatedownloaddialog.ui
)
################################################################
# all
################################################################
set(
SOURCES
${src_SRC}
${src_utils_SRC}
${src_core_SRC}
${src_gui_SRC}
)
set(
HEADERS
${src_HEADERS}
${src_utils_HEADERS}
${src_core_HEADERS}
${src_gui_HEADERS}
)
set(
UI
${src_gui_UI}
)
qt4_wrap_ui( UI_HEADERS ${UI} )
qt4_wrap_cpp( MOC_SOURCES ${HEADERS} )
set( RESOURCES resource.qrc )
qt4_add_resources( QRC_SOURCES ${RESOURCES} )
if(MINGW)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/rc.o
COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR}
-i${CMAKE_CURRENT_SOURCE_DIR}/resource.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/rc.o)
SET(rc_RC ${rc_RC} ${CMAKE_CURRENT_BINARY_DIR}/rc.o)
else(MINGW)
SET(rc_RC ${rc_RC} resource.rc)
endif(MINGW)
if(${CMAKE_BUILD_TYPE} STREQUAL Debug)
add_executable( ${PROJECT_OUTPUT_NAME} ${SOURCES} ${MOC_SOURCES} ${QRC_SOURCES} ${UI_HEADERS} ${rc_RC})
else()
add_executable( ${PROJECT_OUTPUT_NAME} WIN32 ${SOURCES} ${MOC_SOURCES} ${QRC_SOURCES} ${UI_HEADERS} ${rc_RC})
endif()
target_link_libraries( ${PROJECT_OUTPUT_NAME}
${QT_LIBRARIES}
${QTSINGLEAPPLICATION_LIBRARIES}
)