xref: /glogg/glogg.pro (revision dc7f591602f71a2ebc33e33129d447b789c2f683)
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
11eb6a8f99SNicolas BonnefongreaterThan(QT_MAJOR_VERSION, 4): QT += 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 \
27bb02e0acSNicolas Bonnefon    src/mainwindow.cpp \
28bb02e0acSNicolas Bonnefon    src/crawlerwidget.cpp \
29bb02e0acSNicolas Bonnefon    src/abstractlogview.cpp \
30bb02e0acSNicolas Bonnefon    src/logmainview.cpp \
31bb02e0acSNicolas Bonnefon    src/filteredview.cpp \
32bb02e0acSNicolas Bonnefon    src/optionsdialog.cpp \
33bb02e0acSNicolas Bonnefon    src/persistentinfo.cpp \
34bb02e0acSNicolas Bonnefon    src/configuration.cpp \
35bb02e0acSNicolas Bonnefon    src/filtersdialog.cpp \
36bb02e0acSNicolas Bonnefon    src/filterset.cpp \
37bb02e0acSNicolas Bonnefon    src/savedsearches.cpp \
38bb02e0acSNicolas Bonnefon    src/infoline.cpp \
39bb02e0acSNicolas Bonnefon    src/menuactiontooltipbehavior.cpp \
40bb02e0acSNicolas Bonnefon    src/selection.cpp \
41bb02e0acSNicolas Bonnefon    src/quickfind.cpp \
42bb02e0acSNicolas Bonnefon    src/quickfindpattern.cpp \
43bb02e0acSNicolas Bonnefon    src/quickfindwidget.cpp \
44bb02e0acSNicolas Bonnefon    src/sessioninfo.cpp \
45bb02e0acSNicolas Bonnefon    src/recentfiles.cpp \
46bb02e0acSNicolas Bonnefon    src/overview.cpp \
47bb02e0acSNicolas Bonnefon    src/overviewwidget.cpp \
48bb02e0acSNicolas Bonnefon    src/marks.cpp \
49313a820fSNicolas Bonnefon    src/quickfindmux.cpp \
50333b2889SNicolas Bonnefon    src/signalmux.cpp \
51557fb9d8SNicolas Bonnefon    src/tabbedcrawlerwidget.cpp \
52bb02e0acSNicolas Bonnefon
53bb02e0acSNicolas BonnefonINCLUDEPATH += src/
549a361c77SNicolas Bonnefon
556e94dd7aSNicolas BonnefonHEADERS += \
56bb02e0acSNicolas Bonnefon    src/data/abstractlogdata.h \
57bb02e0acSNicolas Bonnefon    src/data/logdata.h \
58bb02e0acSNicolas Bonnefon    src/data/logfiltereddata.h \
59bb02e0acSNicolas Bonnefon    src/data/logfiltereddataworkerthread.h \
60bb02e0acSNicolas Bonnefon    src/data/logdataworkerthread.h \
61bb02e0acSNicolas Bonnefon    src/mainwindow.h \
62d96f3f21SNicolas Bonnefon    src/session.h \
63d96f3f21SNicolas Bonnefon    src/viewinterface.h \
64bb02e0acSNicolas Bonnefon    src/crawlerwidget.h \
65bb02e0acSNicolas Bonnefon    src/logmainview.h \
66bb02e0acSNicolas Bonnefon    src/log.h \
67bb02e0acSNicolas Bonnefon    src/filteredview.h \
68bb02e0acSNicolas Bonnefon    src/abstractlogview.h \
69bb02e0acSNicolas Bonnefon    src/optionsdialog.h \
70bb02e0acSNicolas Bonnefon    src/persistentinfo.h \
71bb02e0acSNicolas Bonnefon    src/configuration.h \
72bb02e0acSNicolas Bonnefon    src/filtersdialog.h \
73bb02e0acSNicolas Bonnefon    src/filterset.h \
74bb02e0acSNicolas Bonnefon    src/savedsearches.h \
75bb02e0acSNicolas Bonnefon    src/infoline.h \
76bb02e0acSNicolas Bonnefon    src/filewatcher.h \
77bb02e0acSNicolas Bonnefon    src/selection.h \
78bb02e0acSNicolas Bonnefon    src/quickfind.h \
79bb02e0acSNicolas Bonnefon    src/quickfindpattern.h \
80bb02e0acSNicolas Bonnefon    src/quickfindwidget.h \
81bb02e0acSNicolas Bonnefon    src/sessioninfo.h \
82bb02e0acSNicolas Bonnefon    src/persistable.h \
83bb02e0acSNicolas Bonnefon    src/recentfiles.h \
84bb02e0acSNicolas Bonnefon    src/menuactiontooltipbehavior.h \
85bb02e0acSNicolas Bonnefon    src/overview.h \
86bb02e0acSNicolas Bonnefon    src/overviewwidget.h \
87bb02e0acSNicolas Bonnefon    src/marks.h \
88bb02e0acSNicolas Bonnefon    src/qfnotifications.h \
89313a820fSNicolas Bonnefon    src/quickfindmux.h \
90093a1bf6SNicolas Bonnefon    src/signalmux.h \
91812146a8SNicolas Bonnefon    src/tabbedcrawlerwidget.h \
92557fb9d8SNicolas Bonnefon    src/loadingstatus.h \
93557fb9d8SNicolas Bonnefon    src/externalcom.h \
949a361c77SNicolas Bonnefon
952f3d4448SNicolas BonnefonisEmpty(BOOST_PATH) {
962f3d4448SNicolas Bonnefon    message(Building using system dynamic Boost libraries)
974b0730ffSNicolas Bonnefon    LIBS += -lboost_program_options
983e90fb01SNicolas Bonnefon}
993e90fb01SNicolas Bonnefonelse {
1002f3d4448SNicolas Bonnefon    message(Building using static Boost libraries at $$BOOST_PATH)
1012f3d4448SNicolas Bonnefon
1022f3d4448SNicolas Bonnefon    SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \
1032f3d4448SNicolas Bonnefon        $$BOOST_PATH/libs/smart_ptr/src/*.cpp
1042f3d4448SNicolas Bonnefon
1052f3d4448SNicolas Bonnefon    INCLUDEPATH += $$BOOST_PATH
1063e90fb01SNicolas Bonnefon}
1073e90fb01SNicolas Bonnefon
108bb02e0acSNicolas BonnefonFORMS += src/optionsdialog.ui
109bb02e0acSNicolas BonnefonFORMS += src/filtersdialog.ui
1109a361c77SNicolas Bonnefon
11136b4ae36SNicolas Bonnefon# For Windows icon
11236b4ae36SNicolas BonnefonRC_FILE = glogg.rc
1139a361c77SNicolas BonnefonRESOURCES = glogg.qrc
1149a361c77SNicolas Bonnefon
115458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available)
116458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) {
117458a6a73SNicolas Bonnefon    MARKDOWN += doc/documentation.markdown
118458a6a73SNicolas Bonnefon}
119458a6a73SNicolas Bonnefonelse {
120458a6a73SNicolas Bonnefon    message("markdown not found, HTML doc will not be generated")
121458a6a73SNicolas Bonnefon}
122458a6a73SNicolas Bonnefon
123458a6a73SNicolas Bonnefondoc_processor.name = markdown
124458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN
125458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html
126458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
127458a6a73SNicolas Bonnefon    sed -f finish.sed >${QMAKE_FILE_OUT}
128458a6a73SNicolas Bonnefon
129458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps
130458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files
131458a6a73SNicolas Bonnefon
132458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor
133458a6a73SNicolas Bonnefon
134b5a5d5faSNicolas Bonnefon# Install (for unix)
135fca14737SNicolas Bonnefonicon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
136fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png
137fca14737SNicolas Bonnefon
138fca14737SNicolas Bonnefonicon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
139fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png
140fca14737SNicolas Bonnefon
1414863be78SNicolas Bonnefonicon_svg.path  = $$PREFIX/share/icons/hicolor/scalable/apps
1424863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg
1434863be78SNicolas Bonnefon
144fca14737SNicolas Bonnefondoc.path  = $$PREFIX/share/doc/glogg
145458a6a73SNicolas Bonnefondoc.files += README COPYING
146fca14737SNicolas Bonnefon
147fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications
14876bf9e67SNicolas Bonnefondesktop.files = glogg.desktop
149fca14737SNicolas Bonnefon
150b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin
1514863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop
152b5a5d5faSNicolas Bonnefon
153b5a5d5faSNicolas Bonnefon# Build directories
154ca3430bfSNicolas BonnefonCONFIG(debug, debug|release) {
155ca3430bfSNicolas Bonnefon    DESTDIR = debug
156ca3430bfSNicolas Bonnefon} else {
157ca3430bfSNicolas Bonnefon    DESTDIR = release
158ca3430bfSNicolas Bonnefon}
1599a361c77SNicolas Bonnefon
160ca3430bfSNicolas BonnefonOBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared
161ca3430bfSNicolas BonnefonMOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared
162ca3430bfSNicolas BonnefonUI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared
163ca3430bfSNicolas Bonnefon
164ca3430bfSNicolas Bonnefon# Debug symbols even in release build
165ca3430bfSNicolas BonnefonQMAKE_CXXFLAGS = -g
166f1ff9ae1SNicolas Bonnefon
167c51eaa77SNicolas Bonnefon# Which compiler are we using
168367bc01eSNicolas Bonnefonsystem( $${QMAKE_CXX} --version | grep -e " 4\\.[7-9]" ) {
169c51eaa77SNicolas Bonnefon    message ( "g++ version 4.7 or newer, supports C++11" )
170c51eaa77SNicolas Bonnefon    CONFIG += C++11
171c51eaa77SNicolas Bonnefon}
172c51eaa77SNicolas Bonnefonelse {
173e38396b0SNicolas Bonnefon    CONFIG += C++0x
174c51eaa77SNicolas Bonnefon}
175c51eaa77SNicolas Bonnefon
176867c74e5SNicolas Bonnefon# Extra compiler arguments
177867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++
178e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra
179c51eaa77SNicolas BonnefonC++0x:QMAKE_CXXFLAGS += -std=c++0x
180c51eaa77SNicolas BonnefonC++11:QMAKE_CXXFLAGS += -std=c++11
181867c74e5SNicolas Bonnefon
18264c49544SNicolas BonnefonGPROF {
18364c49544SNicolas Bonnefon    QMAKE_CXXFLAGS += -pg
18464c49544SNicolas Bonnefon    QMAKE_LFLAGS   += -pg
18564c49544SNicolas Bonnefon}
18664c49544SNicolas Bonnefon
18759d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) {
188ca3430bfSNicolas Bonnefon    CONFIG(debug, debug|release) {
189ca3430bfSNicolas Bonnefon        DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\"
190ca3430bfSNicolas Bonnefon    } else {
191320f9110SNicolas Bonnefon        DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\"
192ca3430bfSNicolas Bonnefon    }
19359d49dccSNicolas Bonnefon}
19459d49dccSNicolas Bonnefonelse {
19559d49dccSNicolas Bonnefon    message("Using specified log level: $$LOG_LEVEL")
19659d49dccSNicolas Bonnefon    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
19759d49dccSNicolas Bonnefon}
1989a361c77SNicolas Bonnefon
199b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"'
200ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) {
201afcc2cb7SNicolas Bonnefon    system([ -f .tarball-version ]) {
202afcc2cb7SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
203afcc2cb7SNicolas Bonnefon    }
204afcc2cb7SNicolas Bonnefon    else {
205b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
206b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
207b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
208b5a5d5faSNicolas Bonnefon    }
209afcc2cb7SNicolas Bonnefon}
210b5a5d5faSNicolas Bonnefonelse {
21121a1b6dcSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
212b5a5d5faSNicolas Bonnefon}
213458a6a73SNicolas Bonnefon
21415af0893SNicolas Bonnefon# Optional features (e.g. CONFIG+=no-dbus)
21515af0893SNicolas Bonnefonsystem(pkg-config --exists QtDBus):!no-dbus {
21615af0893SNicolas Bonnefon    message("Support for D-BUS will be included")
21715af0893SNicolas Bonnefon    QT += dbus
21815af0893SNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_DBUS
21915af0893SNicolas Bonnefon    SOURCES += src/dbusexternalcom.cpp
22015af0893SNicolas Bonnefon    HEADERS += src/dbusexternalcom.h
22115af0893SNicolas Bonnefon}
22215af0893SNicolas Bonnefonelse {
22315af0893SNicolas Bonnefon    message("Support for D-BUS will NOT be included")
22424895119SNicolas Bonnefon    win32 {
22524895119SNicolas Bonnefon        message("Support for Windows IPC will be included")
22624895119SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_WINIPC
22724895119SNicolas Bonnefon        SOURCES += src/winexternalcom.cpp
22824895119SNicolas Bonnefon        HEADERS += src/winexternalcom.h
22924895119SNicolas Bonnefon    }
23015af0893SNicolas Bonnefon}
231431d01deSNicolas Bonnefon
232431d01deSNicolas Bonnefon# Version checking
233f109b95bSNicolas Bonnefonversion_checker {
234367bc01eSNicolas Bonnefon    message("Version checker will be included")
235431d01deSNicolas Bonnefon    QT += network
236431d01deSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_VERSION_CHECKING
237f109b95bSNicolas Bonnefon    SOURCES += src/versionchecker.cpp
238f109b95bSNicolas Bonnefon    HEADERS += src/versionchecker.h
239f109b95bSNicolas Bonnefon}
240f109b95bSNicolas Bonnefonelse {
241367bc01eSNicolas Bonnefon    message("Version checker will NOT be included")
242f109b95bSNicolas Bonnefon}
2436a12446eSNicolas Bonnefon
2446a12446eSNicolas Bonnefon# File watching
2456a12446eSNicolas Bonnefonlinux-g++ {
2466a12446eSNicolas Bonnefon    CONFIG += inotify
2476a12446eSNicolas Bonnefon}
2486a12446eSNicolas Bonnefon
2496a12446eSNicolas Bonnefoninotify {
2506a12446eSNicolas Bonnefon    message("File watching using inotify")
2516a12446eSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_INOTIFY
252*dc7f5916SNicolas Bonnefon    SOURCES += src/platformfilewatcher.cpp src/inotifywatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp
253*dc7f5916SNicolas Bonnefon    HEADERS += src/platformfilewatcher.h src/inotifywatchtowerdriver.h src/watchtower.h src/watchtowerlist.h
25484b2179eSNicolas Bonnefon}
25584b2179eSNicolas Bonnefonelse {
25684b2179eSNicolas Bonnefon    win32 {
25784b2179eSNicolas Bonnefon        SOURCES += src/platformfilewatcher.cpp src/winwatchtower.cpp src/watchtower.cpp
25884b2179eSNicolas Bonnefon        HEADERS += src/platformfilewatcher.cpp src/winwatchtower.h src/watchtower.h
2596a12446eSNicolas Bonnefon    }
2606a12446eSNicolas Bonnefon    else {
2616a12446eSNicolas Bonnefon        SOURCES += src/qtfilewatcher.cpp
2626a12446eSNicolas Bonnefon        HEADERS += src/qtfilewatcher.h
2636a12446eSNicolas Bonnefon    }
26484b2179eSNicolas Bonnefon}
265