forked from jangernert/FeedReader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
300 lines (249 loc) · 8.18 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
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
project (FeedReader)
cmake_minimum_required (VERSION 2.6)
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
include_directories(${CMAKE_SOURCE_DIR}/libVilistextum)
include_directories(${CMAKE_SOURCE_DIR}/libgtkimageview)
include_directories(${CMAKE_SOURCE_DIR})
add_definitions("-w")
include(GNUInstallDirs)
set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
set (PKGDATADIR "${DATADIR}/FeedReader")
set (PKGLIBDIR "${CMAKE_INSTALL_LIBDIR}/FeedReader")
set (GETTEXT_PACKAGE ${CMAKE_PROJECT_NAME})
set (UI_NAME "feedreader")
set (DAEMON_NAME ${UI_NAME}-daemon)
set (WEBEXTENSION_NAME webextension)
set (RELEASE_NAME "FeedReader")
set (VERSION "2.0.1")
set (GLIB_VERSION 2.40)
find_package(PkgConfig)
find_package(Vala REQUIRED)
include(ValaVersion)
include(ValaPrecompile)
include(GResource)
ensure_vala_version("0.30" MINIMUM)
pkg_check_modules(LIBUNITY QUIET unity)
add_definitions (-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
add_subdirectory (po)
add_subdirectory (schemas)
add_subdirectory (libVilistextum)
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Constants.vala.in" "${CMAKE_SOURCE_DIR}/Constants.vala" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/data/org.gnome.FeedReader.Daemon.service.in" "${CMAKE_SOURCE_DIR}/data/org.gnome.FeedReader.Daemon.service" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/data/org.gnome.FeedReader.appdata.xml.in" "${CMAKE_SOURCE_DIR}/data/org.gnome.FeedReader.appdata.xml" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/data/org.gnome.FeedReader.desktop.in" "${CMAKE_SOURCE_DIR}/data/org.gnome.FeedReader.desktop" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/data/org.gnome.FeedReader-autostart.desktop.in" "${CMAKE_SOURCE_DIR}/data/org.gnome.FeedReader-autostart.desktop" @ONLY)
set(MODULES
gtk+-3.0>=3.20
json-glib-1.0
gee-0.8
libsoup-2.4
sqlite3
libsecret-1
libnotify
libxml-2.0
rest-0.7
webkit2gtk-4.0
gstreamer-1.0
gstreamer-pbutils-1.0
libpeas-1.0
libcurl
goa-1.0)
if(LIBUNITY_FOUND)
list(APPEND MODULES unity)
message(STATUS "libunity: ON")
endif(LIBUNITY_FOUND)
pkg_check_modules(DEPS REQUIRED ${MODULES})
add_definitions(${DEPS_CFLAGS} -DGOA_API_IS_SUBJECT_TO_CHANGE)
link_libraries(${DEPS_LIBRARIES} -lm)
link_directories(${DEPS_LIBRARY_DIRS})
add_subdirectory(WebExtension)
add_subdirectory(libgtkimageview)
add_subdirectory(libgd)
################################################################################
vala_precompile(LIBFR libFeedReader
src/Logger.vala
src/Enums.vala
src/dbBase.vala
src/Settings.vala
src/Utils.vala
src/QueryBuilder.vala
src/ContentGrabber/stringPair.vala
src/Model/Feed.vala
src/Model/Category.vala
src/Model/Article.vala
src/Model/Tag.vala
src/Model/CachedAction.vala
src/Model/InterfaceState.vala
src/Model/ShareAccount.vala
Constants.vala
PACKAGES
gee-0.8
libsecret-1
sqlite3
libsoup-2.4
OPTIONS
--target-glib=${GLIB_VERSION}
--vapi=FeedReaderCommon.vapi
--header=FeedReaderCommon.h
CUSTOM_VAPIS
vapi/libvilistextum.vapi
)
add_library(FeedReaderCommon STATIC ${LIBFR})
target_link_libraries(FeedReaderCommon vilistextum)
################################################################################
set(UI_PACKAGES
glib-2.0>=2.32
gtk+-3.0
json-glib-1.0
libsoup-2.4
sqlite3
gee-0.8
libsecret-1
libnotify
rest-0.7
WebKit2-4.0
gstreamer-1.0
gstreamer-pbutils-1.0
libpeas-1.0
goa-1.0)
vala_precompile(UI ${UI_NAME}
src/DBusConnection.vala
src/FavIconCache.vala
src/FeedReader.vala
src/LoginInterface.vala
src/dbUI.vala
src/UtilsUI.vala
src/Widgets/AddPopover.vala
src/Widgets/ArticleRow.vala
src/Widgets/ArticleView.vala
src/Widgets/ArticleViewHeader.vala
src/Widgets/ArticleViewLoadProgress.vala
src/Widgets/ArticleViewUrlOverlay.vala
src/Widgets/BackendInfoPopover.vala
src/Widgets/CategorieRow.vala
src/Widgets/ColorCircle.vala
src/Widgets/ColorPopover.vala
src/Widgets/ColumnView.vala
src/Widgets/ColumnViewHeader.vala
src/Widgets/FeedList.vala
src/Widgets/FeedListFooter.vala
src/Widgets/FeedRow.vala
src/Widgets/FullscreenButton.vala
src/Widgets/FullscreenHeader.vala
src/Widgets/HoverButton.vala
src/Widgets/ImagePopup.vala
src/Widgets/InAppNotification.vala
src/Widgets/InfoBar.vala
src/Widgets/LoginPage.vala
src/Widgets/LoginRow.vala
src/Widgets/MainWindow.vala
src/Widgets/MediaPlayer.vala
src/Widgets/MediaPopover.vala
src/Widgets/MediaRow.vala
src/Widgets/ModeButton.vala
src/Widgets/RemovePopover.vala
src/Widgets/ResetPage.vala
src/Widgets/ServiceSettingsPopover.vala
src/Widgets/ShareRow.vala
src/Widgets/ShortcutsWindow.vala
src/Widgets/ServiceInfo.vala
src/Widgets/Setting.vala
src/Widgets/SettingsDialog.vala
src/Widgets/SharePopover.vala
src/Widgets/SimpleHeader.vala
src/Widgets/SpringCleanPage.vala
src/Widgets/TagRow.vala
src/Widgets/TagPopover.vala
src/Widgets/TagPopoverRow.vala
src/Widgets/UpdateButton.vala
src/Widgets/WebLoginPage.vala
src/Widgets/ArticleList/ArticleList.vala
src/Widgets/ArticleList/ArticleListBox.vala
src/Widgets/ArticleList/ArticleListEmptyLabel.vala
src/Widgets/ArticleList/ArticleListScroll.vala
src/Share/share.vala
src/Share/ServiceSetup.vala
src/Share/ShareAccountInterface.vala
PACKAGES
${UI_PACKAGES}
OPTIONS
--target-glib=${GLIB_VERSION}
--header=FeedReaderUI.h
--vapi=FeedReaderUI.vapi
--enable-experimental
CUSTOM_VAPIS
${CMAKE_BINARY_DIR}/FeedReaderCommon.vapi
vapi/libvilistextum.vapi
vapi/gtkimageview.vapi
vapi/gd-1.0.vapi
)
GLIB_COMPILE_RESOURCES(GRESOURCES SOURCE data/org.gnome.FeedReader.gresource.xml)
add_executable(${UI_NAME} ${UI} ${GRESOURCES})
target_link_libraries(${UI_NAME} vilistextum gtkimageview gd FeedReaderCommon)
################################################################################
set(DAEMON_OPTIONS
--target-glib=${GLIB_VERSION}
--header=FeedReader.h
--vapi=FeedReader.vapi)
set(DAEMON_PACKAGES
glib-2.0>=2.32
gio-2.0
sqlite3
gee-0.8
libsoup-2.4
json-glib-1.0
libnotify
libsecret-1
libxml-2.0
rest-0.7
libpeas-1.0)
if(LIBUNITY_FOUND)
list(APPEND DAEMON_OPTIONS --define WITH_LIBUNITY)
list(APPEND DAEMON_PACKAGES unity)
endif(LIBUNITY_FOUND)
vala_precompile(daemon ${DAEMON_NAME}
src/ActionCache.vala
src/Daemon.vala
src/dbDaemon.vala
src/Notification.vala
src/CachedActionManager.vala
src/Backend/FeedServer.vala
src/Backend/FeedServerInterface.vala
src/Backend/OPMLparser.vala
src/ContentGrabber/grabberConfig.vala
src/ContentGrabber/grabber.vala
src/ContentGrabber/grabberUtils.vala
PACKAGES
${DAEMON_PACKAGES}
OPTIONS
${DAEMON_OPTIONS}
CUSTOM_VAPIS
vapi/libvilistextum.vapi
${CMAKE_BINARY_DIR}/FeedReaderCommon.vapi
)
add_executable(${DAEMON_NAME} ${daemon})
target_link_libraries(${DAEMON_NAME} vilistextum FeedReaderCommon)
################################################################################
add_dependencies(${DAEMON_NAME} FeedReaderCommon)
add_dependencies(${UI_NAME} FeedReaderCommon)
# build plugins
add_subdirectory(plugins)
################################################################################
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/uninstall.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake)
install (TARGETS ${UI_NAME} RUNTIME DESTINATION bin)
install (TARGETS ${DAEMON_NAME} RUNTIME DESTINATION bin)
install (FILES ${PROJECT_BINARY_DIR}/WebExtension/libwebextension.so DESTINATION ${PKGLIBDIR})
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/org.gnome.FeedReader.desktop DESTINATION ${DATADIR}/applications/)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/org.gnome.FeedReader-autostart.desktop DESTINATION ${PKGDATADIR})
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/org.gnome.FeedReader.appdata.xml DESTINATION ${DATADIR}/appdata/)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/org.gnome.FeedReader.Daemon.service DESTINATION ${DATADIR}/dbus-1/services/)
install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/application-icons/hicolor DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons)
install (CODE "execute_process (COMMAND gtk-update-icon-cache -t ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor)")
install (DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/GrabberConfig DESTINATION ${PKGDATADIR})