forked from nickbnf/glogg
-
Notifications
You must be signed in to change notification settings - Fork 1
/
glogg.pro
323 lines (278 loc) · 8.39 KB
/
glogg.pro
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
316
317
318
319
320
321
322
# -------------------------------------------------
# glogg
# -------------------------------------------------
# Debug builds: qmake CONFIG+=debug
# Release builds: qmake
TARGET = glogg
TEMPLATE = app
QT += network
greaterThan(QT_MAJOR_VERSION, 4): QT += core widgets
win32:Debug:CONFIG += console
# Necessary when cross-compiling:
win32:Release:QMAKE_LFLAGS += "-Wl,-subsystem,windows"
# Input
SOURCES += \
src/main.cpp \
src/session.cpp \
src/data/abstractlogdata.cpp \
src/data/logdata.cpp \
src/data/logfiltereddata.cpp \
src/data/logfiltereddataworkerthread.cpp \
src/data/logdataworkerthread.cpp \
src/data/compressedlinestorage.cpp \
src/mainwindow.cpp \
src/crawlerwidget.cpp \
src/abstractlogview.cpp \
src/logmainview.cpp \
src/filteredview.cpp \
src/optionsdialog.cpp \
src/persistentinfo.cpp \
src/configuration.cpp \
src/filtersdialog.cpp \
src/filterset.cpp \
src/savedsearches.cpp \
src/infoline.cpp \
src/menuactiontooltipbehavior.cpp \
src/selection.cpp \
src/quickfind.cpp \
src/quickfindpattern.cpp \
src/quickfindwidget.cpp \
src/sessioninfo.cpp \
src/recentfiles.cpp \
src/overview.cpp \
src/overviewwidget.cpp \
src/marks.cpp \
src/quickfindmux.cpp \
src/signalmux.cpp \
src/tabbedcrawlerwidget.cpp \
src/viewtools.cpp \
src/encodingspeculator.cpp \
src/gloggapp.cpp \
INCLUDEPATH += src/
HEADERS += \
src/data/abstractlogdata.h \
src/data/logdata.h \
src/data/logfiltereddata.h \
src/data/logfiltereddataworkerthread.h \
src/data/logdataworkerthread.h \
src/data/threadprivatestore.h \
src/data/compressedlinestorage.h \
src/data/linepositionarray.h \
src/mainwindow.h \
src/session.h \
src/viewinterface.h \
src/crawlerwidget.h \
src/logmainview.h \
src/log.h \
src/filteredview.h \
src/abstractlogview.h \
src/optionsdialog.h \
src/persistentinfo.h \
src/configuration.h \
src/filtersdialog.h \
src/filterset.h \
src/savedsearches.h \
src/infoline.h \
src/filewatcher.h \
src/selection.h \
src/quickfind.h \
src/quickfindpattern.h \
src/quickfindwidget.h \
src/sessioninfo.h \
src/persistable.h \
src/recentfiles.h \
src/menuactiontooltipbehavior.h \
src/overview.h \
src/overviewwidget.h \
src/marks.h \
src/qfnotifications.h \
src/quickfindmux.h \
src/signalmux.h \
src/tabbedcrawlerwidget.h \
src/loadingstatus.h \
src/externalcom.h \
src/viewtools.h \
src/encodingspeculator.h \
src/gloggapp.h \
isEmpty(BOOST_PATH) {
message(Building using system dynamic Boost libraries)
macx {
# Path for brew installed libs
INCLUDEPATH += /usr/local/include
LIBS += -L/usr/local/lib -lboost_program_options-mt
}
else {
LIBS += -lboost_program_options
}
}
else {
message(Building using static Boost libraries at $$BOOST_PATH)
SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp
exists( $$BOOST_PATH/libs/smart_ptr/src/sp_collector.cpp ) {
message( "'old' version of Boost" )
SOURCES += $$BOOST_PATH/libs/smart_ptr/src/*.cpp
}
else {
message( "'new' version of Boost" )
SOURCES += $$BOOST_PATH/libs/smart_ptr/extras/src/*.cpp
}
INCLUDEPATH += $$BOOST_PATH
}
FORMS += src/optionsdialog.ui
FORMS += src/filtersdialog.ui
macx {
# Icon for Mac
ICON = images/glogg.icns
}
else {
# For Windows icon
RC_ICONS = glogg48.ico
QMAKE_TARGET_COMPANY = "Nicolas Bonnefon"
QMAKE_TARGET_DESCRIPTION = "glogg - the fast, smart log explorer"
}
RESOURCES = glogg.qrc
# Build HTML documentation (if 'markdown' is available)
system(type markdown >/dev/null) {
MARKDOWN += doc/documentation.markdown
}
else {
message("markdown not found, HTML doc will not be generated")
}
doc_processor.name = markdown
doc_processor.input = MARKDOWN
doc_processor.output = doc/${QMAKE_FILE_BASE}.html
doc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
sed -f finish.sed >${QMAKE_FILE_OUT}
doc_processor.CONFIG += target_predeps
doc_processor.variable_out = doc.files
QMAKE_EXTRA_COMPILERS += doc_processor
# Install (for unix)
icon16.path = $$PREFIX/share/icons/hicolor/16x16/apps
icon16.files = images/hicolor/16x16/glogg.png
icon32.path = $$PREFIX/share/icons/hicolor/32x32/apps
icon32.files = images/hicolor/32x32/glogg.png
icon_svg.path = $$PREFIX/share/icons/hicolor/scalable/apps
icon_svg.files = images/hicolor/scalable/glogg.svg
doc.path = $$PREFIX/share/doc/glogg
doc.files += README.md COPYING
desktop.path = $$PREFIX/share/applications
desktop.files = glogg.desktop
target.path = $$PREFIX/bin
INSTALLS = target icon16 icon32 icon_svg doc desktop
# Build directories
CONFIG(debug, debug|release) {
DESTDIR = debug
} else {
DESTDIR = release
}
OBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared
MOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared
UI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared
# Debug symbols even in release build
QMAKE_CXXFLAGS = -g
CONFIG += c++11
# Extra compiler arguments
# QMAKE_CXXFLAGS += -Weffc++
QMAKE_CXXFLAGS += -Wextra
GPROF {
QMAKE_CXXFLAGS += -pg
QMAKE_LFLAGS += -pg
}
isEmpty(LOG_LEVEL) {
CONFIG(debug, debug|release) {
DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\"
} else {
DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\"
}
}
else {
message("Using specified log level: $$LOG_LEVEL")
DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
}
macx {
QMAKE_CXXFLAGS += -stdlib=libc++
QMAKE_LFLAGS += -stdlib=libc++
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8
QMAKE_INFO_PLIST = Info.plist
}
# Official builds can be generated with `qmake VERSION="1.2.3"'
isEmpty(VERSION):system(date >/dev/null) {
system([ -f .tarball-version ]) {
QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
}
else {
QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
}
}
else {
QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
}
# Optional features (e.g. CONFIG+=no-dbus)
system(pkg-config --exists Qt5DBus):!no-dbus {
message("Support for D-BUS will be included")
QT += dbus
QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_DBUS
SOURCES += src/dbusexternalcom.cpp
HEADERS += src/dbusexternalcom.h
}
else {
message("Support for D-BUS will NOT be included")
win32 | macx {
message("Support for cross-platform IPC will be included")
QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_SOCKETIPC
SOURCES += src/socketexternalcom.cpp
HEADERS += src/socketexternalcom.h
}
}
# Version checking
version_checker {
message("Version checker will be included")
QT += network
QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_VERSION_CHECKING
SOURCES += src/versionchecker.cpp
HEADERS += src/versionchecker.h
}
else {
message("Version checker will NOT be included")
}
# File watching
linux-g++ | linux-g++-64 {
CONFIG += inotify
}
macx {
CONFIG += kqueue
}
win32 {
message("File watching using Windows")
SOURCES += src/platformfilewatcher.cpp src/winwatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp
HEADERS += src/platformfilewatcher.h src/winwatchtowerdriver.h src/watchtower.h src/watchtowerlist.h
QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_POLLING
}
else {
inotify {
message("File watching using inotify")
QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_INOTIFY
SOURCES += src/platformfilewatcher.cpp src/inotifywatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp
HEADERS += src/platformfilewatcher.h src/inotifywatchtowerdriver.h src/watchtower.h src/watchtowerlist.h
}
else {
macx {
message("File watching using kqueue")
QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_KQUEUE
SOURCES += src/platformfilewatcher.cpp src/kqueuewatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp
HEADERS += src/platformfilewatcher.h src/kqueuewatchtowerdriver.h src/watchtower.h src/watchtowerlist.h
}
else {
message("File watching using Qt")
SOURCES += src/qtfilewatcher.cpp
HEADERS += src/qtfilewatcher.h
}
}
}
# Performance measurement
perf {
QMAKE_CXXFLAGS += -DGLOGG_PERF_MEASURE_FPS
}
TRANSLATIONS += translations/glogg_zh_CN.ts