File: CMakeLists.txt

package info (click to toggle)
qmpdclient 1.2.2%2Bgit20151118-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 2,728 kB
  • ctags: 2,091
  • sloc: cpp: 9,013; ansic: 2,593; makefile: 4
file content (315 lines) | stat: -rw-r--r-- 7,300 bytes parent folder | download
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
cmake_minimum_required(VERSION 2.6)

find_package(Qt4 4.4.0 COMPONENTS QtCore QtGui QtNetwork QtXml QtXmlPatterns REQUIRED QtDBus)
include(FindPkgConfig)
pkg_check_modules(LIBMPD libmpd REQUIRED)
if(UNIX)
	if(NOT MAC)
		find_package(X11 REQUIRED)
	endif()
endif()

SET (QT_USE_QTNETWORK TRUE)
SET (QT_USE_QTXMLPATTERNS TRUE)
SET (QT_USE_QTXML TRUE)

if(WIN32)
	SET (QT_USE_QTMAIN TRUE)
endif()

if(NOT DEFINED VERSION)
	find_program (GIT_CMD git)
	execute_process (COMMAND "${GIT_CMD}" describe
		OUTPUT_VARIABLE VERSION
		OUTPUT_STRIP_TRAILING_WHITESPACE
		)
	if(NOT VERSION)
		set(VERSION 1.2.2)
	endif()
	message (STATUS "Current version: ${VERSION}")
endif()

set(NAMEVER "QMPDClient ${VERSION}")

set(QMPDClient_srcs
	src/aafilter.cpp
	src/aboutdialog.cpp
	src/abstractmodel.cpp
	src/abstractview.cpp
	src/albumview.cpp
	src/artistview.cpp
	src/clickablelabel.cpp
	src/config.cpp
	src/controlpanel.cpp
	src/coverartdialog.cpp
	src/directorymodel.cpp
	src/directorypanel.cpp
	src/directoryview.cpp
	src/dynamicplaylist.cpp
	src/fileview.cpp
	src/headerview.cpp
	src/iconmanager.cpp
	src/idealbar.cpp
	src/idealsplitter.cpp
	src/lastfmsubmitter.cpp
	src/librarypanel.cpp
	src/lineedit.cpp
	src/lyricsdialog.cpp
	src/mainwindow.cpp
	src/metainfodialog.cpp
	src/mpdcache.cpp
	src/mpdconnection.cpp
	src/mpd.cpp
	src/mpddirectory.cpp
	src/mpdentities.cpp
	src/mpdoutput.cpp
	src/mpdsong.cpp
	src/mpdsonglist.cpp
	src/mpdsongmodel.cpp
	src/mpdsongview.cpp
	src/mpdstats.cpp
	src/mpdstatus.cpp
	src/notifications.cpp
	src/passivepopup.cpp
	src/pausabletimer.cpp
	src/playlistitemdelegate.cpp
	src/playlistmodel.cpp
	src/playlistpanel.cpp
	src/playlistspanel.cpp
	src/playlistsview.cpp
	src/playlistview.cpp
	src/plconview.cpp
	src/plsfile.cpp
	src/preferencesdialog.cpp
	src/qmpdclient.cpp
	src/radiopanel.cpp
	src/radioview.cpp
	src/reconnect.cpp
	src/serverinfo.cpp
	src/servermodel.cpp
	src/shortcutmodel.cpp
	src/shortcuts.cpp
	src/shoutcastmodel.cpp
	src/shoutcastpanel.cpp
	src/shoutcastview.cpp
	src/shoutcastfetcher.cpp
	src/shoutcaststation.cpp
	src/songview.cpp
	src/stringlistmodel.cpp
	src/stringlistview.cpp
	src/tagguesser.cpp
	src/tagmodel.cpp
	src/timelabel.cpp
	src/timeslider.cpp
	src/trayicon.cpp
	src/traysonginfo.cpp
	src/verticalbutton.cpp)

# 	src/qmpdclient_mac.cpp
# 	src/qmpdclient_win.cpp
# 	src/qmpdclient_x11.cpp
# 	src/notifications_dbus.cpp
# 	src/notifications_nodbus.cpp

set(QMPDClient_hdrs
	src/aafilter.h
	src/aboutdialog.h
	src/abstractmodel.h
	src/abstractview_defn.h
	src/abstractview.h
	src/abstractview_impl.h
	src/albumview.h
	src/artistview.h
	src/clickablelabel.h
	src/config.h
	src/controlpanel.h
	src/coverartdialog.h
	src/debug.h
	src/directorymodel.h
	src/directorypanel.h
	src/directoryview.h
	src/dynamicplaylist.h
	src/fileview.h
	src/headerview.h
	src/iconmanager.h
	src/idealbar.h
	src/idealsplitter.h
	src/lastfmsubmitter.h
	src/librarypanel.h
	src/lineedit.h
	src/lyricsdialog.h
	src/macroexpander.h
	src/mainwindow.h
	src/metainfodialog.h
	src/mpdcache.h
	src/mpdcache_p.h
	src/mpdconnection.h
	src/mpddirectory.h
	src/mpdentities.h
	src/mpd.h
	src/mpdoutput.h
	src/mpd_p.h
	src/mpdsong.h
	src/mpdsonglist.h
	src/mpdsongmodel.h
	src/mpdsongview.h
	src/mpdstats.h
	src/mpdstatus.h
	src/notifications.h
	src/passivepopup.h
	src/pausabletimer.h
	src/playlistitemdelegate.h
	src/playlistmodel.h
	src/playlistpanel.h
	src/playlistspanel.h
	src/playlistsview.h
	src/playlistview.h
	src/plconview.h
	src/plsfile.h
	src/preferencesdialog.h
	src/qmpdclient.h
	src/radiopanel.h
	src/radioview.h
	src/reconnect.h
	src/richtext.h
	src/serverinfo.h
	src/servermodel.h
	src/shortcutmodel.h
	src/shortcuts.h
	src/shoutcastpanel.h
	src/shoutcastview.h
	src/shoutcastmodel.h
	src/shoutcastfetcher.h
	src/shoutcaststation.h
	src/songview.h
	src/stringlistmodel.h
	src/stringlistview.h
	src/tagguesser.h
	src/tagmodel.h
	src/timelabel.h
	src/timeslider.h
	src/trayicon.h
	src/traysonginfo.h
	src/verticalbutton.h)

SET(QMPDClient_uis
	ui/aboutdialog.ui
	ui/addradiodialog.ui
	ui/controlpanel.ui
	ui/coverartdialog.ui
	ui/directorypanel.ui
	ui/librarypanel.ui
	ui/lyricsdialog.ui
	ui/mainwindow.ui
	ui/metainfodialog.ui
	ui/playlistpanel.ui
	ui/playlistspanel.ui
	ui/preferencesdialog.ui
	ui/radiopanel.ui
	ui/shoutcastpanel.ui)

if(UNIX)
	if(NOT MAC)
		if(QT_QTDBUS_FOUND)
			message(STATUS "QtDBus found")
			SET (QT_USE_QTDBUS TRUE)
			list(APPEND QMPDClient_srcs src/notifications_dbus.cpp)
			list(APPEND QMPDClient_srcs src/qdbus_adaptor.cpp)
			list(APPEND QMPDClient_hdrs src/qdbus_adaptor.h)
			add_definitions("-DWITH_DBUS")
		else()
			message(STATUS "QtDBus not found")
			list(APPEND QMPDClient_srcs src/notifications_nodbus.cpp)
		endif()
		list(APPEND QMPDClient_srcs src/qmpdclient_x11.cpp)
	else()
		list(APPEND QMPDClient_srcs src/notifications_nodbus.cpp
			src/qmpdclient_mac.cpp)
	endif()
endif()

if(WIN32)
	list(APPEND QMPDClient_srcs src/notifications_nodbus.cpp
			src/qmpdclient_win.cpp icons/resource.rc)
endif()

include(${QT_USE_FILE})
qt4_wrap_cpp(QMPDClient_ppd_hdrs ${QMPDClient_hdrs})
qt4_add_resources(QMPDClient_ppd_res qmpdclient.qrc)
qt4_wrap_ui(QMPDClient_ppd_uis ${QMPDClient_uis})
include_directories (${CMAKE_CURRENT_BINARY_DIR}
	src)

SET (TRANSLATIONS
	lang/cs_CZ.ts
	lang/de_DE.ts
	lang/es_ES.ts
	lang/fr_FR.ts
	lang/it_IT.ts
	lang/nl_NL.ts
	lang/nn_NO.ts
	lang/no_NO.ts
	lang/pt_BR.ts
	lang/ru_RU.ts
	lang/sv_SE.ts
	lang/tr_TR.ts
	lang/uk_UA.ts
	lang/zh_CN.ts
	lang/zh_TW.ts)

SET (COMPILED_TRANSLATIONS
	lang/cs_CZ.qm
	lang/de_DE.qm
	lang/es_ES.qm
	lang/fr_FR.qm
	lang/it_IT.qm
	lang/nl_NL.qm
	lang/nn_NO.qm
	lang/no_NO.qm
	lang/pt_BR.qm
	lang/ru_RU.qm
	lang/sv_SE.qm
	lang/tr_TR.qm
	lang/uk_UA.qm
	lang/zh_CN.qm
	lang/zh_TW.qm)


ADD_CUSTOM_COMMAND (OUTPUT
	${COMPILED_TRANSLATIONS}
	COMMAND "${QT_LRELEASE_EXECUTABLE}" ${TRANSLATIONS}
	DEPENDS ${TRANSLATIONS}
	WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
	)

add_definitions(-DNAMEVER="${NAMEVER}" -DPREFIX="${CMAKE_INSTALL_PREFIX}" -DVERSION="${VERSION}")

add_executable(qmpdclient ${QMPDClient_srcs} ${QMPDClient_ppd_hdrs} ${QMPDClient_ppd_uis} ${QMPDClient_ppd_res} ${COMPILED_TRANSLATIONS})

target_link_libraries(qmpdclient ${QT_LIBRARIES})
if(UNIX)
	if(NOT MAC)
		target_link_libraries(qmpdclient ${X11_LIBRARIES})
	endif()
endif()
if(WIN32)
	target_link_libraries(qmpdclient ws2_32)
	set_target_properties(qmpdclient PROPERTIES WIN32_EXECUTABLE TRUE)
endif()
target_include_directories(qmpdclient PRIVATE ${LIBMPD_INCLUDE_DIRS})
target_link_libraries(qmpdclient ${LIBMPD_LIBRARIES})

if(UNIX)
	install(TARGETS qmpdclient DESTINATION bin)
	install(FILES qmpdclient.desktop DESTINATION share/applications)
	install(FILES icons/64x64/qmpdclient.png DESTINATION share/icons/hicolor/64x64/apps/)
	install(FILES icons/48x48/qmpdclient.png DESTINATION share/icons/hicolor/48x48/apps/)
	install(FILES icons/22x22/qmpdclient.png DESTINATION share/icons/hicolor/22x22/apps/)
	install(FILES icons/16x16/qmpdclient.png DESTINATION share/icons/hicolor/16x16/apps/)
	install(FILES icons/svg/qmpdclient.svg DESTINATION share/icons/hicolor/scalable/apps/)
	install(FILES ${COMPILED_TRANSLATIONS} DESTINATION share/QMPDClient/translations)
endif()
if(WIN32)
	install(TARGETS qmpdclient DESTINATION .)
	install(FILES ${COMPILED_TRANSLATIONS} DESTINATION translations)
endif()