xref: /glogg/glogg.pro (revision a4399322d0114772b79773bdf48ce044f5c71a09)
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
1212f3d4448SNicolas Bonnefon    SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \
1222f3d4448SNicolas Bonnefon        $$BOOST_PATH/libs/smart_ptr/src/*.cpp
1232f3d4448SNicolas Bonnefon
1242f3d4448SNicolas Bonnefon    INCLUDEPATH += $$BOOST_PATH
1253e90fb01SNicolas Bonnefon}
1263e90fb01SNicolas Bonnefon
127bb02e0acSNicolas BonnefonFORMS += src/optionsdialog.ui
128bb02e0acSNicolas BonnefonFORMS += src/filtersdialog.ui
1299a361c77SNicolas Bonnefon
130c11410ccSNicolas Bonnefonmacx {
131c11410ccSNicolas Bonnefon    # Icon for Mac
132c11410ccSNicolas Bonnefon    ICON = images/glogg.icns
133c11410ccSNicolas Bonnefon}
134c11410ccSNicolas Bonnefonelse {
13536b4ae36SNicolas Bonnefon    # For Windows icon
13652b9eccfSAnton Filimonov    RC_ICONS = glogg48.ico
137*a4399322SAnton Filimonov    QMAKE_TARGET_COMPANY = "Nicolas Bonnefon"
138*a4399322SAnton Filimonov    QMAKE_TARGET_DESCRIPTION = "glogg - the fast, smart log explorer"
139c11410ccSNicolas Bonnefon}
140c11410ccSNicolas Bonnefon
1419a361c77SNicolas BonnefonRESOURCES = glogg.qrc
1429a361c77SNicolas Bonnefon
143458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available)
144458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) {
145458a6a73SNicolas Bonnefon    MARKDOWN += doc/documentation.markdown
146458a6a73SNicolas Bonnefon}
147458a6a73SNicolas Bonnefonelse {
148458a6a73SNicolas Bonnefon    message("markdown not found, HTML doc will not be generated")
149458a6a73SNicolas Bonnefon}
150458a6a73SNicolas Bonnefon
151458a6a73SNicolas Bonnefondoc_processor.name = markdown
152458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN
153458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html
154458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
155458a6a73SNicolas Bonnefon    sed -f finish.sed >${QMAKE_FILE_OUT}
156458a6a73SNicolas Bonnefon
157458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps
158458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files
159458a6a73SNicolas Bonnefon
160458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor
161458a6a73SNicolas Bonnefon
162b5a5d5faSNicolas Bonnefon# Install (for unix)
163fca14737SNicolas Bonnefonicon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
164fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png
165fca14737SNicolas Bonnefon
166fca14737SNicolas Bonnefonicon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
167fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png
168fca14737SNicolas Bonnefon
1694863be78SNicolas Bonnefonicon_svg.path  = $$PREFIX/share/icons/hicolor/scalable/apps
1704863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg
1714863be78SNicolas Bonnefon
172fca14737SNicolas Bonnefondoc.path  = $$PREFIX/share/doc/glogg
173458a6a73SNicolas Bonnefondoc.files += README COPYING
174fca14737SNicolas Bonnefon
175fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications
17676bf9e67SNicolas Bonnefondesktop.files = glogg.desktop
177fca14737SNicolas Bonnefon
178b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin
1794863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop
180b5a5d5faSNicolas Bonnefon
181b5a5d5faSNicolas Bonnefon# Build directories
182ca3430bfSNicolas BonnefonCONFIG(debug, debug|release) {
183ca3430bfSNicolas Bonnefon    DESTDIR = debug
184ca3430bfSNicolas Bonnefon} else {
185ca3430bfSNicolas Bonnefon    DESTDIR = release
186ca3430bfSNicolas Bonnefon}
1879a361c77SNicolas Bonnefon
188ca3430bfSNicolas BonnefonOBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared
189ca3430bfSNicolas BonnefonMOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared
190ca3430bfSNicolas BonnefonUI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared
191ca3430bfSNicolas Bonnefon
192ca3430bfSNicolas Bonnefon# Debug symbols even in release build
193ca3430bfSNicolas BonnefonQMAKE_CXXFLAGS = -g
194f1ff9ae1SNicolas Bonnefon
195c51eaa77SNicolas Bonnefon# Which compiler are we using
1961e89d911SNicolas Bonnefonsystem( $${QMAKE_CXX} --version | grep -e " 4\\.[7-9]" ) || macx {
197c51eaa77SNicolas Bonnefon    message ( "g++ version 4.7 or newer, supports C++11" )
198c51eaa77SNicolas Bonnefon    CONFIG += C++11
199c51eaa77SNicolas Bonnefon}
200c51eaa77SNicolas Bonnefonelse {
201e38396b0SNicolas Bonnefon    CONFIG += C++0x
202c51eaa77SNicolas Bonnefon}
203c51eaa77SNicolas Bonnefon
204867c74e5SNicolas Bonnefon# Extra compiler arguments
205867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++
206e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra
207c51eaa77SNicolas BonnefonC++0x:QMAKE_CXXFLAGS += -std=c++0x
208c51eaa77SNicolas BonnefonC++11:QMAKE_CXXFLAGS += -std=c++11
209867c74e5SNicolas Bonnefon
21064c49544SNicolas BonnefonGPROF {
21164c49544SNicolas Bonnefon    QMAKE_CXXFLAGS += -pg
21264c49544SNicolas Bonnefon    QMAKE_LFLAGS   += -pg
21364c49544SNicolas Bonnefon}
21464c49544SNicolas Bonnefon
21559d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) {
216ca3430bfSNicolas Bonnefon    CONFIG(debug, debug|release) {
217ca3430bfSNicolas Bonnefon        DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\"
218ca3430bfSNicolas Bonnefon    } else {
219320f9110SNicolas Bonnefon        DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\"
220ca3430bfSNicolas Bonnefon    }
22159d49dccSNicolas Bonnefon}
22259d49dccSNicolas Bonnefonelse {
22359d49dccSNicolas Bonnefon    message("Using specified log level: $$LOG_LEVEL")
22459d49dccSNicolas Bonnefon    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
22559d49dccSNicolas Bonnefon}
2269a361c77SNicolas Bonnefon
2271e89d911SNicolas Bonnefonmacx {
2281e89d911SNicolas Bonnefon    QMAKE_CXXFLAGS += -stdlib=libc++
2291e89d911SNicolas Bonnefon    QMAKE_LFLAGS += -stdlib=libc++
230f6034637SNicolas Bonnefon
2318b941e12SAnton Filimonov    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
23207cff950SNicolas Bonnefon
23307cff950SNicolas Bonnefon    QMAKE_INFO_PLIST = Info.plist
2341e89d911SNicolas Bonnefon}
2351e89d911SNicolas Bonnefon
236b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"'
237ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) {
238afcc2cb7SNicolas Bonnefon    system([ -f .tarball-version ]) {
239afcc2cb7SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
240afcc2cb7SNicolas Bonnefon    }
241afcc2cb7SNicolas Bonnefon    else {
242b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
243b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
244b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
245b5a5d5faSNicolas Bonnefon    }
246afcc2cb7SNicolas Bonnefon}
247b5a5d5faSNicolas Bonnefonelse {
24821a1b6dcSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
249b5a5d5faSNicolas Bonnefon}
250458a6a73SNicolas Bonnefon
25115af0893SNicolas Bonnefon# Optional features (e.g. CONFIG+=no-dbus)
25215af0893SNicolas Bonnefonsystem(pkg-config --exists QtDBus):!no-dbus {
25315af0893SNicolas Bonnefon    message("Support for D-BUS will be included")
25415af0893SNicolas Bonnefon    QT += dbus
25515af0893SNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_DBUS
25615af0893SNicolas Bonnefon    SOURCES += src/dbusexternalcom.cpp
25715af0893SNicolas Bonnefon    HEADERS += src/dbusexternalcom.h
25815af0893SNicolas Bonnefon}
25915af0893SNicolas Bonnefonelse {
26015af0893SNicolas Bonnefon    message("Support for D-BUS will NOT be included")
2610374f408SAnton Filimonov    win32 || macx {
2620374f408SAnton Filimonov        message("Support for cross-platform IPC will be included")
2632d1bee56SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_SOCKETIPC
2640374f408SAnton Filimonov        SOURCES += src/socketexternalcom.cpp
2650374f408SAnton Filimonov        HEADERS += src/socketexternalcom.h
26624895119SNicolas Bonnefon    }
26715af0893SNicolas Bonnefon}
268431d01deSNicolas Bonnefon
269431d01deSNicolas Bonnefon# Version checking
270f109b95bSNicolas Bonnefonversion_checker {
271367bc01eSNicolas Bonnefon    message("Version checker will be included")
272431d01deSNicolas Bonnefon    QT += network
273431d01deSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_VERSION_CHECKING
274f109b95bSNicolas Bonnefon    SOURCES += src/versionchecker.cpp
275f109b95bSNicolas Bonnefon    HEADERS += src/versionchecker.h
276f109b95bSNicolas Bonnefon}
277f109b95bSNicolas Bonnefonelse {
278367bc01eSNicolas Bonnefon    message("Version checker will NOT be included")
279f109b95bSNicolas Bonnefon}
2806a12446eSNicolas Bonnefon
2816a12446eSNicolas Bonnefon# File watching
28201f773eaSNicolas Bonnefonlinux-g++ || linux-g++-64 {
2836a12446eSNicolas Bonnefon    CONFIG += inotify
2846a12446eSNicolas Bonnefon}
2856a12446eSNicolas Bonnefon
28680bca0a3SNicolas Bonnefonwin32 {
28780bca0a3SNicolas Bonnefon    message("File watching using Windows")
28880bca0a3SNicolas Bonnefon    SOURCES += src/platformfilewatcher.cpp src/winwatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp
28980bca0a3SNicolas Bonnefon    HEADERS += src/platformfilewatcher.h src/winwatchtowerdriver.h src/watchtower.h src/watchtowerlist.h
29080bca0a3SNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_POLLING
29180bca0a3SNicolas Bonnefon}
29280bca0a3SNicolas Bonnefonelse {
2936a12446eSNicolas Bonnefon    inotify {
2946a12446eSNicolas Bonnefon        message("File watching using inotify")
2956a12446eSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_INOTIFY
296dc7f5916SNicolas Bonnefon        SOURCES += src/platformfilewatcher.cpp src/inotifywatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp
297dc7f5916SNicolas Bonnefon        HEADERS += src/platformfilewatcher.h src/inotifywatchtowerdriver.h src/watchtower.h src/watchtowerlist.h
29884b2179eSNicolas Bonnefon    }
29984b2179eSNicolas Bonnefon    else {
30001f773eaSNicolas Bonnefon        message("File watching using Qt")
3016a12446eSNicolas Bonnefon        SOURCES += src/qtfilewatcher.cpp
3026a12446eSNicolas Bonnefon        HEADERS += src/qtfilewatcher.h
3036a12446eSNicolas Bonnefon    }
30484b2179eSNicolas Bonnefon}
3058bda3285SNicolas Bonnefon
3068bda3285SNicolas Bonnefon# Performance measurement
3078bda3285SNicolas Bonnefonperf {
3088bda3285SNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_PERF_MEASURE_FPS
3098bda3285SNicolas Bonnefon}
310