xref: /glogg/glogg.pro (revision c11410ccb3bacfef588832c6719d881a6f2b408a)
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
111e89d911SNicolas BonnefongreaterThan(QT_MAJOR_VERSION, 4): QT += core widgets
12eb6a8f99SNicolas Bonnefon
139a361c77SNicolas Bonnefonwin32:Debug:CONFIG += console
14320f9110SNicolas Bonnefon
153597d419SNicolas Bonnefon# Necessary when cross-compiling:
163597d419SNicolas Bonnefonwin32:Release:QMAKE_LFLAGS += "-Wl,-subsystem,windows"
179a361c77SNicolas Bonnefon
189a361c77SNicolas Bonnefon# Input
19bb02e0acSNicolas BonnefonSOURCES += \
20bb02e0acSNicolas Bonnefon    src/main.cpp \
21d96f3f21SNicolas Bonnefon    src/session.cpp \
22bb02e0acSNicolas Bonnefon    src/data/abstractlogdata.cpp \
23bb02e0acSNicolas Bonnefon    src/data/logdata.cpp \
24bb02e0acSNicolas Bonnefon    src/data/logfiltereddata.cpp \
25bb02e0acSNicolas Bonnefon    src/data/logfiltereddataworkerthread.cpp \
26bb02e0acSNicolas Bonnefon    src/data/logdataworkerthread.cpp \
273c46a469SNicolas Bonnefon    src/data/compressedlinestorage.cpp \
28bb02e0acSNicolas Bonnefon    src/mainwindow.cpp \
29bb02e0acSNicolas Bonnefon    src/crawlerwidget.cpp \
30bb02e0acSNicolas Bonnefon    src/abstractlogview.cpp \
31bb02e0acSNicolas Bonnefon    src/logmainview.cpp \
32bb02e0acSNicolas Bonnefon    src/filteredview.cpp \
33bb02e0acSNicolas Bonnefon    src/optionsdialog.cpp \
34bb02e0acSNicolas Bonnefon    src/persistentinfo.cpp \
35bb02e0acSNicolas Bonnefon    src/configuration.cpp \
36bb02e0acSNicolas Bonnefon    src/filtersdialog.cpp \
37bb02e0acSNicolas Bonnefon    src/filterset.cpp \
38bb02e0acSNicolas Bonnefon    src/savedsearches.cpp \
39bb02e0acSNicolas Bonnefon    src/infoline.cpp \
40bb02e0acSNicolas Bonnefon    src/menuactiontooltipbehavior.cpp \
41bb02e0acSNicolas Bonnefon    src/selection.cpp \
42bb02e0acSNicolas Bonnefon    src/quickfind.cpp \
43bb02e0acSNicolas Bonnefon    src/quickfindpattern.cpp \
44bb02e0acSNicolas Bonnefon    src/quickfindwidget.cpp \
45bb02e0acSNicolas Bonnefon    src/sessioninfo.cpp \
46bb02e0acSNicolas Bonnefon    src/recentfiles.cpp \
47bb02e0acSNicolas Bonnefon    src/overview.cpp \
48bb02e0acSNicolas Bonnefon    src/overviewwidget.cpp \
49bb02e0acSNicolas Bonnefon    src/marks.cpp \
50313a820fSNicolas Bonnefon    src/quickfindmux.cpp \
51333b2889SNicolas Bonnefon    src/signalmux.cpp \
52557fb9d8SNicolas Bonnefon    src/tabbedcrawlerwidget.cpp \
530b05c6eaSNicolas Bonnefon    src/viewtools.cpp \
545fa25391SNicolas Bonnefon    src/encodingspeculator.cpp \
55bb02e0acSNicolas Bonnefon
56bb02e0acSNicolas BonnefonINCLUDEPATH += src/
579a361c77SNicolas Bonnefon
586e94dd7aSNicolas BonnefonHEADERS += \
59bb02e0acSNicolas Bonnefon    src/data/abstractlogdata.h \
60bb02e0acSNicolas Bonnefon    src/data/logdata.h \
61bb02e0acSNicolas Bonnefon    src/data/logfiltereddata.h \
62bb02e0acSNicolas Bonnefon    src/data/logfiltereddataworkerthread.h \
63bb02e0acSNicolas Bonnefon    src/data/logdataworkerthread.h \
64bb02e0acSNicolas Bonnefon    src/mainwindow.h \
65d96f3f21SNicolas Bonnefon    src/session.h \
66d96f3f21SNicolas Bonnefon    src/viewinterface.h \
67bb02e0acSNicolas Bonnefon    src/crawlerwidget.h \
68bb02e0acSNicolas Bonnefon    src/logmainview.h \
69bb02e0acSNicolas Bonnefon    src/log.h \
70bb02e0acSNicolas Bonnefon    src/filteredview.h \
71bb02e0acSNicolas Bonnefon    src/abstractlogview.h \
72bb02e0acSNicolas Bonnefon    src/optionsdialog.h \
73bb02e0acSNicolas Bonnefon    src/persistentinfo.h \
74bb02e0acSNicolas Bonnefon    src/configuration.h \
75bb02e0acSNicolas Bonnefon    src/filtersdialog.h \
76bb02e0acSNicolas Bonnefon    src/filterset.h \
77bb02e0acSNicolas Bonnefon    src/savedsearches.h \
78bb02e0acSNicolas Bonnefon    src/infoline.h \
79bb02e0acSNicolas Bonnefon    src/filewatcher.h \
80bb02e0acSNicolas Bonnefon    src/selection.h \
81bb02e0acSNicolas Bonnefon    src/quickfind.h \
82bb02e0acSNicolas Bonnefon    src/quickfindpattern.h \
83bb02e0acSNicolas Bonnefon    src/quickfindwidget.h \
84bb02e0acSNicolas Bonnefon    src/sessioninfo.h \
85bb02e0acSNicolas Bonnefon    src/persistable.h \
86bb02e0acSNicolas Bonnefon    src/recentfiles.h \
87bb02e0acSNicolas Bonnefon    src/menuactiontooltipbehavior.h \
88bb02e0acSNicolas Bonnefon    src/overview.h \
89bb02e0acSNicolas Bonnefon    src/overviewwidget.h \
90bb02e0acSNicolas Bonnefon    src/marks.h \
91bb02e0acSNicolas Bonnefon    src/qfnotifications.h \
92313a820fSNicolas Bonnefon    src/quickfindmux.h \
93093a1bf6SNicolas Bonnefon    src/signalmux.h \
94812146a8SNicolas Bonnefon    src/tabbedcrawlerwidget.h \
95557fb9d8SNicolas Bonnefon    src/loadingstatus.h \
96557fb9d8SNicolas Bonnefon    src/externalcom.h \
970b05c6eaSNicolas Bonnefon    src/viewtools.h \
985fa25391SNicolas Bonnefon    src/encodingspeculator.h \
999a361c77SNicolas Bonnefon
1002f3d4448SNicolas BonnefonisEmpty(BOOST_PATH) {
1012f3d4448SNicolas Bonnefon    message(Building using system dynamic Boost libraries)
1021e89d911SNicolas Bonnefon    macx {
1031e89d911SNicolas Bonnefon      # Path for brew installed libs
1041e89d911SNicolas Bonnefon      INCLUDEPATH += /usr/local/include
1051e89d911SNicolas Bonnefon      LIBS += -L/usr/local/lib -lboost_program_options-mt
1061e89d911SNicolas Bonnefon    }
1071e89d911SNicolas Bonnefon    else {
1084b0730ffSNicolas Bonnefon      LIBS += -lboost_program_options
1093e90fb01SNicolas Bonnefon    }
1101e89d911SNicolas Bonnefon}
1113e90fb01SNicolas Bonnefonelse {
1122f3d4448SNicolas Bonnefon    message(Building using static Boost libraries at $$BOOST_PATH)
1132f3d4448SNicolas Bonnefon
1142f3d4448SNicolas Bonnefon    SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \
1152f3d4448SNicolas Bonnefon        $$BOOST_PATH/libs/smart_ptr/src/*.cpp
1162f3d4448SNicolas Bonnefon
1172f3d4448SNicolas Bonnefon    INCLUDEPATH += $$BOOST_PATH
1183e90fb01SNicolas Bonnefon}
1193e90fb01SNicolas Bonnefon
120bb02e0acSNicolas BonnefonFORMS += src/optionsdialog.ui
121bb02e0acSNicolas BonnefonFORMS += src/filtersdialog.ui
1229a361c77SNicolas Bonnefon
123*c11410ccSNicolas Bonnefonmacx {
124*c11410ccSNicolas Bonnefon    # Icon for Mac
125*c11410ccSNicolas Bonnefon    ICON = images/glogg.icns
126*c11410ccSNicolas Bonnefon}
127*c11410ccSNicolas Bonnefonelse {
12836b4ae36SNicolas Bonnefon    # For Windows icon
12936b4ae36SNicolas Bonnefon    RC_FILE = glogg.rc
130*c11410ccSNicolas Bonnefon}
131*c11410ccSNicolas Bonnefon
1329a361c77SNicolas BonnefonRESOURCES = glogg.qrc
1339a361c77SNicolas Bonnefon
134458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available)
135458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) {
136458a6a73SNicolas Bonnefon    MARKDOWN += doc/documentation.markdown
137458a6a73SNicolas Bonnefon}
138458a6a73SNicolas Bonnefonelse {
139458a6a73SNicolas Bonnefon    message("markdown not found, HTML doc will not be generated")
140458a6a73SNicolas Bonnefon}
141458a6a73SNicolas Bonnefon
142458a6a73SNicolas Bonnefondoc_processor.name = markdown
143458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN
144458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html
145458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
146458a6a73SNicolas Bonnefon    sed -f finish.sed >${QMAKE_FILE_OUT}
147458a6a73SNicolas Bonnefon
148458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps
149458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files
150458a6a73SNicolas Bonnefon
151458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor
152458a6a73SNicolas Bonnefon
153b5a5d5faSNicolas Bonnefon# Install (for unix)
154fca14737SNicolas Bonnefonicon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
155fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png
156fca14737SNicolas Bonnefon
157fca14737SNicolas Bonnefonicon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
158fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png
159fca14737SNicolas Bonnefon
1604863be78SNicolas Bonnefonicon_svg.path  = $$PREFIX/share/icons/hicolor/scalable/apps
1614863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg
1624863be78SNicolas Bonnefon
163fca14737SNicolas Bonnefondoc.path  = $$PREFIX/share/doc/glogg
164458a6a73SNicolas Bonnefondoc.files += README COPYING
165fca14737SNicolas Bonnefon
166fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications
16776bf9e67SNicolas Bonnefondesktop.files = glogg.desktop
168fca14737SNicolas Bonnefon
169b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin
1704863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop
171b5a5d5faSNicolas Bonnefon
172b5a5d5faSNicolas Bonnefon# Build directories
173ca3430bfSNicolas BonnefonCONFIG(debug, debug|release) {
174ca3430bfSNicolas Bonnefon    DESTDIR = debug
175ca3430bfSNicolas Bonnefon} else {
176ca3430bfSNicolas Bonnefon    DESTDIR = release
177ca3430bfSNicolas Bonnefon}
1789a361c77SNicolas Bonnefon
179ca3430bfSNicolas BonnefonOBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared
180ca3430bfSNicolas BonnefonMOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared
181ca3430bfSNicolas BonnefonUI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared
182ca3430bfSNicolas Bonnefon
183ca3430bfSNicolas Bonnefon# Debug symbols even in release build
184ca3430bfSNicolas BonnefonQMAKE_CXXFLAGS = -g
185f1ff9ae1SNicolas Bonnefon
186c51eaa77SNicolas Bonnefon# Which compiler are we using
1871e89d911SNicolas Bonnefonsystem( $${QMAKE_CXX} --version | grep -e " 4\\.[7-9]" ) || macx {
188c51eaa77SNicolas Bonnefon    message ( "g++ version 4.7 or newer, supports C++11" )
189c51eaa77SNicolas Bonnefon    CONFIG += C++11
190c51eaa77SNicolas Bonnefon}
191c51eaa77SNicolas Bonnefonelse {
192e38396b0SNicolas Bonnefon    CONFIG += C++0x
193c51eaa77SNicolas Bonnefon}
194c51eaa77SNicolas Bonnefon
195867c74e5SNicolas Bonnefon# Extra compiler arguments
196867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++
197e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra
198c51eaa77SNicolas BonnefonC++0x:QMAKE_CXXFLAGS += -std=c++0x
199c51eaa77SNicolas BonnefonC++11:QMAKE_CXXFLAGS += -std=c++11
200867c74e5SNicolas Bonnefon
20164c49544SNicolas BonnefonGPROF {
20264c49544SNicolas Bonnefon    QMAKE_CXXFLAGS += -pg
20364c49544SNicolas Bonnefon    QMAKE_LFLAGS   += -pg
20464c49544SNicolas Bonnefon}
20564c49544SNicolas Bonnefon
20659d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) {
207ca3430bfSNicolas Bonnefon    CONFIG(debug, debug|release) {
208ca3430bfSNicolas Bonnefon        DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\"
209ca3430bfSNicolas Bonnefon    } else {
210320f9110SNicolas Bonnefon        DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\"
211ca3430bfSNicolas Bonnefon    }
21259d49dccSNicolas Bonnefon}
21359d49dccSNicolas Bonnefonelse {
21459d49dccSNicolas Bonnefon    message("Using specified log level: $$LOG_LEVEL")
21559d49dccSNicolas Bonnefon    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
21659d49dccSNicolas Bonnefon}
2179a361c77SNicolas Bonnefon
2181e89d911SNicolas Bonnefonmacx {
2191e89d911SNicolas Bonnefon    QMAKE_CXXFLAGS += -stdlib=libc++
2201e89d911SNicolas Bonnefon    QMAKE_LFLAGS += -stdlib=libc++
2211e89d911SNicolas Bonnefon}
2221e89d911SNicolas Bonnefon
223b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"'
224ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) {
225afcc2cb7SNicolas Bonnefon    system([ -f .tarball-version ]) {
226afcc2cb7SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
227afcc2cb7SNicolas Bonnefon    }
228afcc2cb7SNicolas Bonnefon    else {
229b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
230b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
231b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
232b5a5d5faSNicolas Bonnefon    }
233afcc2cb7SNicolas Bonnefon}
234b5a5d5faSNicolas Bonnefonelse {
23521a1b6dcSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
236b5a5d5faSNicolas Bonnefon}
237458a6a73SNicolas Bonnefon
23815af0893SNicolas Bonnefon# Optional features (e.g. CONFIG+=no-dbus)
23915af0893SNicolas Bonnefonsystem(pkg-config --exists QtDBus):!no-dbus {
24015af0893SNicolas Bonnefon    message("Support for D-BUS will be included")
24115af0893SNicolas Bonnefon    QT += dbus
24215af0893SNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_DBUS
24315af0893SNicolas Bonnefon    SOURCES += src/dbusexternalcom.cpp
24415af0893SNicolas Bonnefon    HEADERS += src/dbusexternalcom.h
24515af0893SNicolas Bonnefon}
24615af0893SNicolas Bonnefonelse {
24715af0893SNicolas Bonnefon    message("Support for D-BUS will NOT be included")
24824895119SNicolas Bonnefon    win32 {
24924895119SNicolas Bonnefon        message("Support for Windows IPC will be included")
25024895119SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_WINIPC
25124895119SNicolas Bonnefon        SOURCES += src/winexternalcom.cpp
25224895119SNicolas Bonnefon        HEADERS += src/winexternalcom.h
25324895119SNicolas Bonnefon    }
25415af0893SNicolas Bonnefon}
255431d01deSNicolas Bonnefon
256431d01deSNicolas Bonnefon# Version checking
257f109b95bSNicolas Bonnefonversion_checker {
258367bc01eSNicolas Bonnefon    message("Version checker will be included")
259431d01deSNicolas Bonnefon    QT += network
260431d01deSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_VERSION_CHECKING
261f109b95bSNicolas Bonnefon    SOURCES += src/versionchecker.cpp
262f109b95bSNicolas Bonnefon    HEADERS += src/versionchecker.h
263f109b95bSNicolas Bonnefon}
264f109b95bSNicolas Bonnefonelse {
265367bc01eSNicolas Bonnefon    message("Version checker will NOT be included")
266f109b95bSNicolas Bonnefon}
2676a12446eSNicolas Bonnefon
2686a12446eSNicolas Bonnefon# File watching
26901f773eaSNicolas Bonnefonlinux-g++ || linux-g++-64 {
2706a12446eSNicolas Bonnefon    CONFIG += inotify
2716a12446eSNicolas Bonnefon}
2726a12446eSNicolas Bonnefon
27380bca0a3SNicolas Bonnefonwin32 {
27480bca0a3SNicolas Bonnefon    message("File watching using Windows")
27580bca0a3SNicolas Bonnefon    SOURCES += src/platformfilewatcher.cpp src/winwatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp
27680bca0a3SNicolas Bonnefon    HEADERS += src/platformfilewatcher.h src/winwatchtowerdriver.h src/watchtower.h src/watchtowerlist.h
27780bca0a3SNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_POLLING
27880bca0a3SNicolas Bonnefon}
27980bca0a3SNicolas Bonnefonelse {
2806a12446eSNicolas Bonnefon    inotify {
2816a12446eSNicolas Bonnefon        message("File watching using inotify")
2826a12446eSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_INOTIFY
283dc7f5916SNicolas Bonnefon        SOURCES += src/platformfilewatcher.cpp src/inotifywatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp
284dc7f5916SNicolas Bonnefon        HEADERS += src/platformfilewatcher.h src/inotifywatchtowerdriver.h src/watchtower.h src/watchtowerlist.h
28584b2179eSNicolas Bonnefon    }
28684b2179eSNicolas Bonnefon    else {
28701f773eaSNicolas Bonnefon        message("File watching using Qt")
2886a12446eSNicolas Bonnefon        SOURCES += src/qtfilewatcher.cpp
2896a12446eSNicolas Bonnefon        HEADERS += src/qtfilewatcher.h
2906a12446eSNicolas Bonnefon    }
29184b2179eSNicolas Bonnefon}
2928bda3285SNicolas Bonnefon
2938bda3285SNicolas Bonnefon# Performance measurement
2948bda3285SNicolas Bonnefonperf {
2958bda3285SNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_PERF_MEASURE_FPS
2968bda3285SNicolas Bonnefon}
297