xref: /glogg/glogg.pro (revision 5fb101c8049ef778c6c8411e44024847024eb1d8)
19a361c77SNicolas Bonnefon# -------------------------------------------------
29a361c77SNicolas Bonnefon# glogg
39a361c77SNicolas Bonnefon# -------------------------------------------------
4ca3430bfSNicolas Bonnefon
5ca3430bfSNicolas Bonnefon# Debug builds: qmake CONFIG+=debug
6ca3430bfSNicolas Bonnefon# Release builds: qmake
7ca3430bfSNicolas Bonnefon
89a361c77SNicolas BonnefonTARGET = glogg
99a361c77SNicolas BonnefonTEMPLATE = app
109a361c77SNicolas Bonnefon
110374f408SAnton FilimonovQT += network
120374f408SAnton Filimonov
131e89d911SNicolas BonnefongreaterThan(QT_MAJOR_VERSION, 4): QT += core widgets
14eb6a8f99SNicolas Bonnefon
159a361c77SNicolas Bonnefonwin32:Debug:CONFIG += console
16320f9110SNicolas Bonnefon
173597d419SNicolas Bonnefon# Necessary when cross-compiling:
183597d419SNicolas Bonnefonwin32:Release:QMAKE_LFLAGS += "-Wl,-subsystem,windows"
199a361c77SNicolas Bonnefon
209a361c77SNicolas Bonnefon# Input
21bb02e0acSNicolas BonnefonSOURCES += \
22bb02e0acSNicolas Bonnefon    src/main.cpp \
23d96f3f21SNicolas Bonnefon    src/session.cpp \
24bb02e0acSNicolas Bonnefon    src/data/abstractlogdata.cpp \
25bb02e0acSNicolas Bonnefon    src/data/logdata.cpp \
26bb02e0acSNicolas Bonnefon    src/data/logfiltereddata.cpp \
27bb02e0acSNicolas Bonnefon    src/data/logfiltereddataworkerthread.cpp \
28bb02e0acSNicolas Bonnefon    src/data/logdataworkerthread.cpp \
293c46a469SNicolas Bonnefon    src/data/compressedlinestorage.cpp \
30bb02e0acSNicolas Bonnefon    src/mainwindow.cpp \
31bb02e0acSNicolas Bonnefon    src/crawlerwidget.cpp \
32bb02e0acSNicolas Bonnefon    src/abstractlogview.cpp \
33bb02e0acSNicolas Bonnefon    src/logmainview.cpp \
34bb02e0acSNicolas Bonnefon    src/filteredview.cpp \
35bb02e0acSNicolas Bonnefon    src/optionsdialog.cpp \
36bb02e0acSNicolas Bonnefon    src/persistentinfo.cpp \
37bb02e0acSNicolas Bonnefon    src/configuration.cpp \
38bb02e0acSNicolas Bonnefon    src/filtersdialog.cpp \
39bb02e0acSNicolas Bonnefon    src/filterset.cpp \
40bb02e0acSNicolas Bonnefon    src/savedsearches.cpp \
41bb02e0acSNicolas Bonnefon    src/infoline.cpp \
42bb02e0acSNicolas Bonnefon    src/menuactiontooltipbehavior.cpp \
43bb02e0acSNicolas Bonnefon    src/selection.cpp \
44bb02e0acSNicolas Bonnefon    src/quickfind.cpp \
45bb02e0acSNicolas Bonnefon    src/quickfindpattern.cpp \
46bb02e0acSNicolas Bonnefon    src/quickfindwidget.cpp \
47bb02e0acSNicolas Bonnefon    src/sessioninfo.cpp \
48bb02e0acSNicolas Bonnefon    src/recentfiles.cpp \
49bb02e0acSNicolas Bonnefon    src/overview.cpp \
50bb02e0acSNicolas Bonnefon    src/overviewwidget.cpp \
51bb02e0acSNicolas Bonnefon    src/marks.cpp \
52313a820fSNicolas Bonnefon    src/quickfindmux.cpp \
53333b2889SNicolas Bonnefon    src/signalmux.cpp \
54557fb9d8SNicolas Bonnefon    src/tabbedcrawlerwidget.cpp \
550b05c6eaSNicolas Bonnefon    src/viewtools.cpp \
565fa25391SNicolas Bonnefon    src/encodingspeculator.cpp \
57ba1adacfSNicolas Bonnefon    src/gloggapp.cpp \
58bb02e0acSNicolas Bonnefon
59bb02e0acSNicolas BonnefonINCLUDEPATH += src/
609a361c77SNicolas Bonnefon
616e94dd7aSNicolas BonnefonHEADERS += \
62bb02e0acSNicolas Bonnefon    src/data/abstractlogdata.h \
63bb02e0acSNicolas Bonnefon    src/data/logdata.h \
64bb02e0acSNicolas Bonnefon    src/data/logfiltereddata.h \
65bb02e0acSNicolas Bonnefon    src/data/logfiltereddataworkerthread.h \
66bb02e0acSNicolas Bonnefon    src/data/logdataworkerthread.h \
670374f408SAnton Filimonov    src/data/threadprivatestore.h \
680374f408SAnton Filimonov    src/data/compressedlinestorage.h \
690374f408SAnton Filimonov    src/data/linepositionarray.h \
70bb02e0acSNicolas Bonnefon    src/mainwindow.h \
71d96f3f21SNicolas Bonnefon    src/session.h \
72d96f3f21SNicolas Bonnefon    src/viewinterface.h \
73bb02e0acSNicolas Bonnefon    src/crawlerwidget.h \
74bb02e0acSNicolas Bonnefon    src/logmainview.h \
75bb02e0acSNicolas Bonnefon    src/log.h \
76bb02e0acSNicolas Bonnefon    src/filteredview.h \
77bb02e0acSNicolas Bonnefon    src/abstractlogview.h \
78bb02e0acSNicolas Bonnefon    src/optionsdialog.h \
79bb02e0acSNicolas Bonnefon    src/persistentinfo.h \
80bb02e0acSNicolas Bonnefon    src/configuration.h \
81bb02e0acSNicolas Bonnefon    src/filtersdialog.h \
82bb02e0acSNicolas Bonnefon    src/filterset.h \
83bb02e0acSNicolas Bonnefon    src/savedsearches.h \
84bb02e0acSNicolas Bonnefon    src/infoline.h \
85bb02e0acSNicolas Bonnefon    src/filewatcher.h \
86bb02e0acSNicolas Bonnefon    src/selection.h \
87bb02e0acSNicolas Bonnefon    src/quickfind.h \
88bb02e0acSNicolas Bonnefon    src/quickfindpattern.h \
89bb02e0acSNicolas Bonnefon    src/quickfindwidget.h \
90bb02e0acSNicolas Bonnefon    src/sessioninfo.h \
91bb02e0acSNicolas Bonnefon    src/persistable.h \
92bb02e0acSNicolas Bonnefon    src/recentfiles.h \
93bb02e0acSNicolas Bonnefon    src/menuactiontooltipbehavior.h \
94bb02e0acSNicolas Bonnefon    src/overview.h \
95bb02e0acSNicolas Bonnefon    src/overviewwidget.h \
96bb02e0acSNicolas Bonnefon    src/marks.h \
97bb02e0acSNicolas Bonnefon    src/qfnotifications.h \
98313a820fSNicolas Bonnefon    src/quickfindmux.h \
99093a1bf6SNicolas Bonnefon    src/signalmux.h \
100812146a8SNicolas Bonnefon    src/tabbedcrawlerwidget.h \
101557fb9d8SNicolas Bonnefon    src/loadingstatus.h \
102557fb9d8SNicolas Bonnefon    src/externalcom.h \
1030b05c6eaSNicolas Bonnefon    src/viewtools.h \
1045fa25391SNicolas Bonnefon    src/encodingspeculator.h \
105ba1adacfSNicolas Bonnefon    src/gloggapp.h \
1069a361c77SNicolas Bonnefon
1072f3d4448SNicolas BonnefonisEmpty(BOOST_PATH) {
1082f3d4448SNicolas Bonnefon    message(Building using system dynamic Boost libraries)
1091e89d911SNicolas Bonnefon    macx {
1101e89d911SNicolas Bonnefon      # Path for brew installed libs
1111e89d911SNicolas Bonnefon      INCLUDEPATH += /usr/local/include
1121e89d911SNicolas Bonnefon      LIBS += -L/usr/local/lib -lboost_program_options-mt
1131e89d911SNicolas Bonnefon    }
1141e89d911SNicolas Bonnefon    else {
1154b0730ffSNicolas Bonnefon      LIBS += -lboost_program_options
1163e90fb01SNicolas Bonnefon    }
1171e89d911SNicolas Bonnefon}
1183e90fb01SNicolas Bonnefonelse {
1192f3d4448SNicolas Bonnefon    message(Building using static Boost libraries at $$BOOST_PATH)
1202f3d4448SNicolas Bonnefon
121*5fb101c8SNicolas Bonnefon    SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp
122*5fb101c8SNicolas Bonnefon
123*5fb101c8SNicolas Bonnefon    exists( $$BOOST_PATH/libs/smart_ptr/src/sp_collector.cpp ) {
124*5fb101c8SNicolas Bonnefon        message( "'old' version of Boost" )
125*5fb101c8SNicolas Bonnefon        SOURCES += $$BOOST_PATH/libs/smart_ptr/src/*.cpp
126*5fb101c8SNicolas Bonnefon    }
127*5fb101c8SNicolas Bonnefon    else {
128*5fb101c8SNicolas Bonnefon        message( "'new' version of Boost" )
129*5fb101c8SNicolas Bonnefon        SOURCES += $$BOOST_PATH/libs/smart_ptr/extras/src/*.cpp
130*5fb101c8SNicolas Bonnefon    }
1312f3d4448SNicolas Bonnefon
1322f3d4448SNicolas Bonnefon    INCLUDEPATH += $$BOOST_PATH
1333e90fb01SNicolas Bonnefon}
1343e90fb01SNicolas Bonnefon
135bb02e0acSNicolas BonnefonFORMS += src/optionsdialog.ui
136bb02e0acSNicolas BonnefonFORMS += src/filtersdialog.ui
1379a361c77SNicolas Bonnefon
138c11410ccSNicolas Bonnefonmacx {
139c11410ccSNicolas Bonnefon    # Icon for Mac
140c11410ccSNicolas Bonnefon    ICON = images/glogg.icns
141c11410ccSNicolas Bonnefon}
142c11410ccSNicolas Bonnefonelse {
14336b4ae36SNicolas Bonnefon    # For Windows icon
14452b9eccfSAnton Filimonov    RC_ICONS = glogg48.ico
145a4399322SAnton Filimonov    QMAKE_TARGET_COMPANY = "Nicolas Bonnefon"
146a4399322SAnton Filimonov    QMAKE_TARGET_DESCRIPTION = "glogg - the fast, smart log explorer"
147c11410ccSNicolas Bonnefon}
148c11410ccSNicolas Bonnefon
1499a361c77SNicolas BonnefonRESOURCES = glogg.qrc
1509a361c77SNicolas Bonnefon
151458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available)
152458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) {
153458a6a73SNicolas Bonnefon    MARKDOWN += doc/documentation.markdown
154458a6a73SNicolas Bonnefon}
155458a6a73SNicolas Bonnefonelse {
156458a6a73SNicolas Bonnefon    message("markdown not found, HTML doc will not be generated")
157458a6a73SNicolas Bonnefon}
158458a6a73SNicolas Bonnefon
159458a6a73SNicolas Bonnefondoc_processor.name = markdown
160458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN
161458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html
162458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
163458a6a73SNicolas Bonnefon    sed -f finish.sed >${QMAKE_FILE_OUT}
164458a6a73SNicolas Bonnefon
165458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps
166458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files
167458a6a73SNicolas Bonnefon
168458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor
169458a6a73SNicolas Bonnefon
170b5a5d5faSNicolas Bonnefon# Install (for unix)
171fca14737SNicolas Bonnefonicon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
172fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png
173fca14737SNicolas Bonnefon
174fca14737SNicolas Bonnefonicon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
175fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png
176fca14737SNicolas Bonnefon
1774863be78SNicolas Bonnefonicon_svg.path  = $$PREFIX/share/icons/hicolor/scalable/apps
1784863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg
1794863be78SNicolas Bonnefon
180fca14737SNicolas Bonnefondoc.path  = $$PREFIX/share/doc/glogg
181458a6a73SNicolas Bonnefondoc.files += README COPYING
182fca14737SNicolas Bonnefon
183fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications
18476bf9e67SNicolas Bonnefondesktop.files = glogg.desktop
185fca14737SNicolas Bonnefon
186b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin
1874863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop
188b5a5d5faSNicolas Bonnefon
189b5a5d5faSNicolas Bonnefon# Build directories
190ca3430bfSNicolas BonnefonCONFIG(debug, debug|release) {
191ca3430bfSNicolas Bonnefon    DESTDIR = debug
192ca3430bfSNicolas Bonnefon} else {
193ca3430bfSNicolas Bonnefon    DESTDIR = release
194ca3430bfSNicolas Bonnefon}
1959a361c77SNicolas Bonnefon
196ca3430bfSNicolas BonnefonOBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared
197ca3430bfSNicolas BonnefonMOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared
198ca3430bfSNicolas BonnefonUI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared
199ca3430bfSNicolas Bonnefon
200ca3430bfSNicolas Bonnefon# Debug symbols even in release build
201ca3430bfSNicolas BonnefonQMAKE_CXXFLAGS = -g
202f1ff9ae1SNicolas Bonnefon
2039f1607b1SAlexander HirschCONFIG += c++11
204c51eaa77SNicolas Bonnefon
205867c74e5SNicolas Bonnefon# Extra compiler arguments
206867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++
207e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra
208867c74e5SNicolas Bonnefon
20964c49544SNicolas BonnefonGPROF {
21064c49544SNicolas Bonnefon    QMAKE_CXXFLAGS += -pg
21164c49544SNicolas Bonnefon    QMAKE_LFLAGS   += -pg
21264c49544SNicolas Bonnefon}
21364c49544SNicolas Bonnefon
21459d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) {
215ca3430bfSNicolas Bonnefon    CONFIG(debug, debug|release) {
216ca3430bfSNicolas Bonnefon        DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\"
217ca3430bfSNicolas Bonnefon    } else {
218320f9110SNicolas Bonnefon        DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\"
219ca3430bfSNicolas Bonnefon    }
22059d49dccSNicolas Bonnefon}
22159d49dccSNicolas Bonnefonelse {
22259d49dccSNicolas Bonnefon    message("Using specified log level: $$LOG_LEVEL")
22359d49dccSNicolas Bonnefon    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
22459d49dccSNicolas Bonnefon}
2259a361c77SNicolas Bonnefon
2261e89d911SNicolas Bonnefonmacx {
2271e89d911SNicolas Bonnefon    QMAKE_CXXFLAGS += -stdlib=libc++
2281e89d911SNicolas Bonnefon    QMAKE_LFLAGS += -stdlib=libc++
229f6034637SNicolas Bonnefon
2305a87faaeSAnton Filimonov    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8
23107cff950SNicolas Bonnefon
23207cff950SNicolas Bonnefon    QMAKE_INFO_PLIST = Info.plist
2331e89d911SNicolas Bonnefon}
2341e89d911SNicolas Bonnefon
235b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"'
236ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) {
237afcc2cb7SNicolas Bonnefon    system([ -f .tarball-version ]) {
238afcc2cb7SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
239afcc2cb7SNicolas Bonnefon    }
240afcc2cb7SNicolas Bonnefon    else {
241b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
242b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
243b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
244b5a5d5faSNicolas Bonnefon    }
245afcc2cb7SNicolas Bonnefon}
246b5a5d5faSNicolas Bonnefonelse {
24721a1b6dcSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
248b5a5d5faSNicolas Bonnefon}
249458a6a73SNicolas Bonnefon
25015af0893SNicolas Bonnefon# Optional features (e.g. CONFIG+=no-dbus)
2519fc0a80eSAlexander Hirschsystem(pkg-config --exists Qt5DBus):!no-dbus {
25215af0893SNicolas Bonnefon    message("Support for D-BUS will be included")
25315af0893SNicolas Bonnefon    QT += dbus
25415af0893SNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_DBUS
25515af0893SNicolas Bonnefon    SOURCES += src/dbusexternalcom.cpp
25615af0893SNicolas Bonnefon    HEADERS += src/dbusexternalcom.h
25715af0893SNicolas Bonnefon}
25815af0893SNicolas Bonnefonelse {
25915af0893SNicolas Bonnefon    message("Support for D-BUS will NOT be included")
260b9a25f81SAlexander Hirsch    win32 | macx {
2610374f408SAnton Filimonov        message("Support for cross-platform IPC will be included")
2622d1bee56SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_SOCKETIPC
2630374f408SAnton Filimonov        SOURCES += src/socketexternalcom.cpp
2640374f408SAnton Filimonov        HEADERS += src/socketexternalcom.h
26524895119SNicolas Bonnefon    }
26615af0893SNicolas Bonnefon}
267431d01deSNicolas Bonnefon
268431d01deSNicolas Bonnefon# Version checking
269f109b95bSNicolas Bonnefonversion_checker {
270367bc01eSNicolas Bonnefon    message("Version checker will be included")
271431d01deSNicolas Bonnefon    QT += network
272431d01deSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_VERSION_CHECKING
273f109b95bSNicolas Bonnefon    SOURCES += src/versionchecker.cpp
274f109b95bSNicolas Bonnefon    HEADERS += src/versionchecker.h
275f109b95bSNicolas Bonnefon}
276f109b95bSNicolas Bonnefonelse {
277367bc01eSNicolas Bonnefon    message("Version checker will NOT be included")
278f109b95bSNicolas Bonnefon}
2796a12446eSNicolas Bonnefon
2806a12446eSNicolas Bonnefon# File watching
281b9a25f81SAlexander Hirschlinux-g++ | linux-g++-64 {
2826a12446eSNicolas Bonnefon    CONFIG += inotify
2836a12446eSNicolas Bonnefon}
2846a12446eSNicolas Bonnefon
285f869e41dSNicolas Bonnefonmacx {
286f869e41dSNicolas Bonnefon    CONFIG += kqueue
287f869e41dSNicolas Bonnefon}
288f869e41dSNicolas Bonnefon
28980bca0a3SNicolas Bonnefonwin32 {
29080bca0a3SNicolas Bonnefon    message("File watching using Windows")
29180bca0a3SNicolas Bonnefon    SOURCES += src/platformfilewatcher.cpp src/winwatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp
29280bca0a3SNicolas Bonnefon    HEADERS += src/platformfilewatcher.h src/winwatchtowerdriver.h src/watchtower.h src/watchtowerlist.h
29380bca0a3SNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_POLLING
29480bca0a3SNicolas Bonnefon}
29580bca0a3SNicolas Bonnefonelse {
2966a12446eSNicolas Bonnefon    inotify {
2976a12446eSNicolas Bonnefon        message("File watching using inotify")
2986a12446eSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_INOTIFY
299dc7f5916SNicolas Bonnefon        SOURCES += src/platformfilewatcher.cpp src/inotifywatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp
300dc7f5916SNicolas Bonnefon        HEADERS += src/platformfilewatcher.h src/inotifywatchtowerdriver.h src/watchtower.h src/watchtowerlist.h
30184b2179eSNicolas Bonnefon    }
30284b2179eSNicolas Bonnefon    else {
303f869e41dSNicolas Bonnefon        macx {
304f869e41dSNicolas Bonnefon            message("File watching using kqueue")
305f869e41dSNicolas Bonnefon            QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_KQUEUE
306f869e41dSNicolas Bonnefon            SOURCES += src/platformfilewatcher.cpp src/kqueuewatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp
307f869e41dSNicolas Bonnefon            HEADERS += src/platformfilewatcher.h src/kqueuewatchtowerdriver.h src/watchtower.h src/watchtowerlist.h
308f869e41dSNicolas Bonnefon        }
309f869e41dSNicolas Bonnefon        else {
31001f773eaSNicolas Bonnefon            message("File watching using Qt")
3116a12446eSNicolas Bonnefon            SOURCES += src/qtfilewatcher.cpp
3126a12446eSNicolas Bonnefon            HEADERS += src/qtfilewatcher.h
3136a12446eSNicolas Bonnefon        }
31484b2179eSNicolas Bonnefon    }
315f869e41dSNicolas Bonnefon}
3168bda3285SNicolas Bonnefon
3178bda3285SNicolas Bonnefon# Performance measurement
3188bda3285SNicolas Bonnefonperf {
3198bda3285SNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_PERF_MEASURE_FPS
3208bda3285SNicolas Bonnefon}
321