xref: /glogg/glogg.pro (revision 8b941e123ddc1953f679547d44fb51d36b42e416)
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 \
57bb02e0acSNicolas Bonnefon
58bb02e0acSNicolas BonnefonINCLUDEPATH += src/
599a361c77SNicolas Bonnefon
606e94dd7aSNicolas BonnefonHEADERS += \
61bb02e0acSNicolas Bonnefon    src/data/abstractlogdata.h \
62bb02e0acSNicolas Bonnefon    src/data/logdata.h \
63bb02e0acSNicolas Bonnefon    src/data/logfiltereddata.h \
64bb02e0acSNicolas Bonnefon    src/data/logfiltereddataworkerthread.h \
65bb02e0acSNicolas Bonnefon    src/data/logdataworkerthread.h \
660374f408SAnton Filimonov    src/data/threadprivatestore.h \
670374f408SAnton Filimonov    src/data/compressedlinestorage.h \
680374f408SAnton Filimonov    src/data/linepositionarray.h \
69bb02e0acSNicolas Bonnefon    src/mainwindow.h \
70d96f3f21SNicolas Bonnefon    src/session.h \
71d96f3f21SNicolas Bonnefon    src/viewinterface.h \
72bb02e0acSNicolas Bonnefon    src/crawlerwidget.h \
73bb02e0acSNicolas Bonnefon    src/logmainview.h \
74bb02e0acSNicolas Bonnefon    src/log.h \
75bb02e0acSNicolas Bonnefon    src/filteredview.h \
76bb02e0acSNicolas Bonnefon    src/abstractlogview.h \
77bb02e0acSNicolas Bonnefon    src/optionsdialog.h \
78bb02e0acSNicolas Bonnefon    src/persistentinfo.h \
79bb02e0acSNicolas Bonnefon    src/configuration.h \
80bb02e0acSNicolas Bonnefon    src/filtersdialog.h \
81bb02e0acSNicolas Bonnefon    src/filterset.h \
82bb02e0acSNicolas Bonnefon    src/savedsearches.h \
83bb02e0acSNicolas Bonnefon    src/infoline.h \
84bb02e0acSNicolas Bonnefon    src/filewatcher.h \
85bb02e0acSNicolas Bonnefon    src/selection.h \
86bb02e0acSNicolas Bonnefon    src/quickfind.h \
87bb02e0acSNicolas Bonnefon    src/quickfindpattern.h \
88bb02e0acSNicolas Bonnefon    src/quickfindwidget.h \
89bb02e0acSNicolas Bonnefon    src/sessioninfo.h \
90bb02e0acSNicolas Bonnefon    src/persistable.h \
91bb02e0acSNicolas Bonnefon    src/recentfiles.h \
92bb02e0acSNicolas Bonnefon    src/menuactiontooltipbehavior.h \
93bb02e0acSNicolas Bonnefon    src/overview.h \
94bb02e0acSNicolas Bonnefon    src/overviewwidget.h \
95bb02e0acSNicolas Bonnefon    src/marks.h \
96bb02e0acSNicolas Bonnefon    src/qfnotifications.h \
97313a820fSNicolas Bonnefon    src/quickfindmux.h \
98093a1bf6SNicolas Bonnefon    src/signalmux.h \
99812146a8SNicolas Bonnefon    src/tabbedcrawlerwidget.h \
100557fb9d8SNicolas Bonnefon    src/loadingstatus.h \
101557fb9d8SNicolas Bonnefon    src/externalcom.h \
1020b05c6eaSNicolas Bonnefon    src/viewtools.h \
1035fa25391SNicolas Bonnefon    src/encodingspeculator.h \
1049a361c77SNicolas Bonnefon
1052f3d4448SNicolas BonnefonisEmpty(BOOST_PATH) {
1062f3d4448SNicolas Bonnefon    message(Building using system dynamic Boost libraries)
1071e89d911SNicolas Bonnefon    macx {
1081e89d911SNicolas Bonnefon      # Path for brew installed libs
1091e89d911SNicolas Bonnefon      INCLUDEPATH += /usr/local/include
1101e89d911SNicolas Bonnefon      LIBS += -L/usr/local/lib -lboost_program_options-mt
1111e89d911SNicolas Bonnefon    }
1121e89d911SNicolas Bonnefon    else {
1134b0730ffSNicolas Bonnefon      LIBS += -lboost_program_options
1143e90fb01SNicolas Bonnefon    }
1151e89d911SNicolas Bonnefon}
1163e90fb01SNicolas Bonnefonelse {
1172f3d4448SNicolas Bonnefon    message(Building using static Boost libraries at $$BOOST_PATH)
1182f3d4448SNicolas Bonnefon
1192f3d4448SNicolas Bonnefon    SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \
1202f3d4448SNicolas Bonnefon        $$BOOST_PATH/libs/smart_ptr/src/*.cpp
1212f3d4448SNicolas Bonnefon
1222f3d4448SNicolas Bonnefon    INCLUDEPATH += $$BOOST_PATH
1233e90fb01SNicolas Bonnefon}
1243e90fb01SNicolas Bonnefon
125bb02e0acSNicolas BonnefonFORMS += src/optionsdialog.ui
126bb02e0acSNicolas BonnefonFORMS += src/filtersdialog.ui
1279a361c77SNicolas Bonnefon
128c11410ccSNicolas Bonnefonmacx {
129c11410ccSNicolas Bonnefon    # Icon for Mac
130c11410ccSNicolas Bonnefon    ICON = images/glogg.icns
131c11410ccSNicolas Bonnefon}
132c11410ccSNicolas Bonnefonelse {
13336b4ae36SNicolas Bonnefon    # For Windows icon
13436b4ae36SNicolas Bonnefon    RC_FILE = glogg.rc
135c11410ccSNicolas Bonnefon}
136c11410ccSNicolas Bonnefon
1379a361c77SNicolas BonnefonRESOURCES = glogg.qrc
1389a361c77SNicolas Bonnefon
139458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available)
140458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) {
141458a6a73SNicolas Bonnefon    MARKDOWN += doc/documentation.markdown
142458a6a73SNicolas Bonnefon}
143458a6a73SNicolas Bonnefonelse {
144458a6a73SNicolas Bonnefon    message("markdown not found, HTML doc will not be generated")
145458a6a73SNicolas Bonnefon}
146458a6a73SNicolas Bonnefon
147458a6a73SNicolas Bonnefondoc_processor.name = markdown
148458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN
149458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html
150458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
151458a6a73SNicolas Bonnefon    sed -f finish.sed >${QMAKE_FILE_OUT}
152458a6a73SNicolas Bonnefon
153458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps
154458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files
155458a6a73SNicolas Bonnefon
156458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor
157458a6a73SNicolas Bonnefon
158b5a5d5faSNicolas Bonnefon# Install (for unix)
159fca14737SNicolas Bonnefonicon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
160fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png
161fca14737SNicolas Bonnefon
162fca14737SNicolas Bonnefonicon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
163fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png
164fca14737SNicolas Bonnefon
1654863be78SNicolas Bonnefonicon_svg.path  = $$PREFIX/share/icons/hicolor/scalable/apps
1664863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg
1674863be78SNicolas Bonnefon
168fca14737SNicolas Bonnefondoc.path  = $$PREFIX/share/doc/glogg
169458a6a73SNicolas Bonnefondoc.files += README COPYING
170fca14737SNicolas Bonnefon
171fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications
17276bf9e67SNicolas Bonnefondesktop.files = glogg.desktop
173fca14737SNicolas Bonnefon
174b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin
1754863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop
176b5a5d5faSNicolas Bonnefon
177b5a5d5faSNicolas Bonnefon# Build directories
178ca3430bfSNicolas BonnefonCONFIG(debug, debug|release) {
179ca3430bfSNicolas Bonnefon    DESTDIR = debug
180ca3430bfSNicolas Bonnefon} else {
181ca3430bfSNicolas Bonnefon    DESTDIR = release
182ca3430bfSNicolas Bonnefon}
1839a361c77SNicolas Bonnefon
184ca3430bfSNicolas BonnefonOBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared
185ca3430bfSNicolas BonnefonMOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared
186ca3430bfSNicolas BonnefonUI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared
187ca3430bfSNicolas Bonnefon
188ca3430bfSNicolas Bonnefon# Debug symbols even in release build
189ca3430bfSNicolas BonnefonQMAKE_CXXFLAGS = -g
190f1ff9ae1SNicolas Bonnefon
191c51eaa77SNicolas Bonnefon# Which compiler are we using
1921e89d911SNicolas Bonnefonsystem( $${QMAKE_CXX} --version | grep -e " 4\\.[7-9]" ) || macx {
193c51eaa77SNicolas Bonnefon    message ( "g++ version 4.7 or newer, supports C++11" )
194c51eaa77SNicolas Bonnefon    CONFIG += C++11
195c51eaa77SNicolas Bonnefon}
196c51eaa77SNicolas Bonnefonelse {
197e38396b0SNicolas Bonnefon    CONFIG += C++0x
198c51eaa77SNicolas Bonnefon}
199c51eaa77SNicolas Bonnefon
200867c74e5SNicolas Bonnefon# Extra compiler arguments
201867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++
202e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra
203c51eaa77SNicolas BonnefonC++0x:QMAKE_CXXFLAGS += -std=c++0x
204c51eaa77SNicolas BonnefonC++11:QMAKE_CXXFLAGS += -std=c++11
205867c74e5SNicolas Bonnefon
20664c49544SNicolas BonnefonGPROF {
20764c49544SNicolas Bonnefon    QMAKE_CXXFLAGS += -pg
20864c49544SNicolas Bonnefon    QMAKE_LFLAGS   += -pg
20964c49544SNicolas Bonnefon}
21064c49544SNicolas Bonnefon
21159d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) {
212ca3430bfSNicolas Bonnefon    CONFIG(debug, debug|release) {
213ca3430bfSNicolas Bonnefon        DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\"
214ca3430bfSNicolas Bonnefon    } else {
215320f9110SNicolas Bonnefon        DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\"
216ca3430bfSNicolas Bonnefon    }
21759d49dccSNicolas Bonnefon}
21859d49dccSNicolas Bonnefonelse {
21959d49dccSNicolas Bonnefon    message("Using specified log level: $$LOG_LEVEL")
22059d49dccSNicolas Bonnefon    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
22159d49dccSNicolas Bonnefon}
2229a361c77SNicolas Bonnefon
2231e89d911SNicolas Bonnefonmacx {
2241e89d911SNicolas Bonnefon    QMAKE_CXXFLAGS += -stdlib=libc++
2251e89d911SNicolas Bonnefon    QMAKE_LFLAGS += -stdlib=libc++
226f6034637SNicolas Bonnefon
227*8b941e12SAnton Filimonov    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
2281e89d911SNicolas Bonnefon}
2291e89d911SNicolas Bonnefon
230b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"'
231ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) {
232afcc2cb7SNicolas Bonnefon    system([ -f .tarball-version ]) {
233afcc2cb7SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
234afcc2cb7SNicolas Bonnefon    }
235afcc2cb7SNicolas Bonnefon    else {
236b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
237b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
238b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
239b5a5d5faSNicolas Bonnefon    }
240afcc2cb7SNicolas Bonnefon}
241b5a5d5faSNicolas Bonnefonelse {
24221a1b6dcSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
243b5a5d5faSNicolas Bonnefon}
244458a6a73SNicolas Bonnefon
24515af0893SNicolas Bonnefon# Optional features (e.g. CONFIG+=no-dbus)
24615af0893SNicolas Bonnefonsystem(pkg-config --exists QtDBus):!no-dbus {
24715af0893SNicolas Bonnefon    message("Support for D-BUS will be included")
24815af0893SNicolas Bonnefon    QT += dbus
24915af0893SNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_DBUS
25015af0893SNicolas Bonnefon    SOURCES += src/dbusexternalcom.cpp
25115af0893SNicolas Bonnefon    HEADERS += src/dbusexternalcom.h
25215af0893SNicolas Bonnefon}
25315af0893SNicolas Bonnefonelse {
25415af0893SNicolas Bonnefon    message("Support for D-BUS will NOT be included")
2550374f408SAnton Filimonov    win32 || macx {
2560374f408SAnton Filimonov        message("Support for cross-platform IPC will be included")
2572d1bee56SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_SOCKETIPC
2580374f408SAnton Filimonov        SOURCES += src/socketexternalcom.cpp
2590374f408SAnton Filimonov        HEADERS += src/socketexternalcom.h
26024895119SNicolas Bonnefon    }
26115af0893SNicolas Bonnefon}
262431d01deSNicolas Bonnefon
263431d01deSNicolas Bonnefon# Version checking
264f109b95bSNicolas Bonnefonversion_checker {
265367bc01eSNicolas Bonnefon    message("Version checker will be included")
266431d01deSNicolas Bonnefon    QT += network
267431d01deSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_VERSION_CHECKING
268f109b95bSNicolas Bonnefon    SOURCES += src/versionchecker.cpp
269f109b95bSNicolas Bonnefon    HEADERS += src/versionchecker.h
270f109b95bSNicolas Bonnefon}
271f109b95bSNicolas Bonnefonelse {
272367bc01eSNicolas Bonnefon    message("Version checker will NOT be included")
273f109b95bSNicolas Bonnefon}
2746a12446eSNicolas Bonnefon
2756a12446eSNicolas Bonnefon# File watching
27601f773eaSNicolas Bonnefonlinux-g++ || linux-g++-64 {
2776a12446eSNicolas Bonnefon    CONFIG += inotify
2786a12446eSNicolas Bonnefon}
2796a12446eSNicolas Bonnefon
28080bca0a3SNicolas Bonnefonwin32 {
28180bca0a3SNicolas Bonnefon    message("File watching using Windows")
28280bca0a3SNicolas Bonnefon    SOURCES += src/platformfilewatcher.cpp src/winwatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp
28380bca0a3SNicolas Bonnefon    HEADERS += src/platformfilewatcher.h src/winwatchtowerdriver.h src/watchtower.h src/watchtowerlist.h
28480bca0a3SNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_POLLING
28580bca0a3SNicolas Bonnefon}
28680bca0a3SNicolas Bonnefonelse {
2876a12446eSNicolas Bonnefon    inotify {
2886a12446eSNicolas Bonnefon        message("File watching using inotify")
2896a12446eSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_INOTIFY
290dc7f5916SNicolas Bonnefon        SOURCES += src/platformfilewatcher.cpp src/inotifywatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp
291dc7f5916SNicolas Bonnefon        HEADERS += src/platformfilewatcher.h src/inotifywatchtowerdriver.h src/watchtower.h src/watchtowerlist.h
29284b2179eSNicolas Bonnefon    }
29384b2179eSNicolas Bonnefon    else {
29401f773eaSNicolas Bonnefon        message("File watching using Qt")
2956a12446eSNicolas Bonnefon        SOURCES += src/qtfilewatcher.cpp
2966a12446eSNicolas Bonnefon        HEADERS += src/qtfilewatcher.h
2976a12446eSNicolas Bonnefon    }
29884b2179eSNicolas Bonnefon}
2998bda3285SNicolas Bonnefon
3008bda3285SNicolas Bonnefon# Performance measurement
3018bda3285SNicolas Bonnefonperf {
3028bda3285SNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_PERF_MEASURE_FPS
3038bda3285SNicolas Bonnefon}
304