xref: /glogg/glogg.pro (revision 557fb9d8925f3772c017d921d356ab742ec51021)
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
13*557fb9d8SNicolas BonnefonQT += dbus
14*557fb9d8SNicolas Bonnefon
159a361c77SNicolas Bonnefonwin32:Debug:CONFIG += console
163597d419SNicolas Bonnefon# Necessary when cross-compiling:
173597d419SNicolas Bonnefonwin32:Release:QMAKE_LFLAGS += "-Wl,-subsystem,windows"
189a361c77SNicolas Bonnefon
199a361c77SNicolas Bonnefon# Input
20bb02e0acSNicolas BonnefonSOURCES += \
21bb02e0acSNicolas Bonnefon    src/main.cpp \
22d96f3f21SNicolas Bonnefon    src/session.cpp \
23bb02e0acSNicolas Bonnefon    src/data/abstractlogdata.cpp \
24bb02e0acSNicolas Bonnefon    src/data/logdata.cpp \
25bb02e0acSNicolas Bonnefon    src/data/logfiltereddata.cpp \
26bb02e0acSNicolas Bonnefon    src/data/logfiltereddataworkerthread.cpp \
27bb02e0acSNicolas Bonnefon    src/data/logdataworkerthread.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/filewatcher.cpp \
42bb02e0acSNicolas Bonnefon    src/selection.cpp \
43bb02e0acSNicolas Bonnefon    src/quickfind.cpp \
44bb02e0acSNicolas Bonnefon    src/quickfindpattern.cpp \
45bb02e0acSNicolas Bonnefon    src/quickfindwidget.cpp \
46bb02e0acSNicolas Bonnefon    src/sessioninfo.cpp \
47bb02e0acSNicolas Bonnefon    src/recentfiles.cpp \
48bb02e0acSNicolas Bonnefon    src/overview.cpp \
49bb02e0acSNicolas Bonnefon    src/overviewwidget.cpp \
50bb02e0acSNicolas Bonnefon    src/marks.cpp \
51313a820fSNicolas Bonnefon    src/quickfindmux.cpp \
52333b2889SNicolas Bonnefon    src/signalmux.cpp \
53*557fb9d8SNicolas Bonnefon    src/tabbedcrawlerwidget.cpp \
54*557fb9d8SNicolas Bonnefon    src/dbusexternalcom.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 \
95*557fb9d8SNicolas Bonnefon    src/loadingstatus.h \
96*557fb9d8SNicolas Bonnefon    src/externalcom.h \
97*557fb9d8SNicolas Bonnefon    src/dbusexternalcom.h
989a361c77SNicolas Bonnefon
992f3d4448SNicolas BonnefonisEmpty(BOOST_PATH) {
1002f3d4448SNicolas Bonnefon    message(Building using system dynamic Boost libraries)
1014b0730ffSNicolas Bonnefon    LIBS += -lboost_program_options
1023e90fb01SNicolas Bonnefon}
1033e90fb01SNicolas Bonnefonelse {
1042f3d4448SNicolas Bonnefon    message(Building using static Boost libraries at $$BOOST_PATH)
1052f3d4448SNicolas Bonnefon
1062f3d4448SNicolas Bonnefon    SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \
1072f3d4448SNicolas Bonnefon        $$BOOST_PATH/libs/smart_ptr/src/*.cpp
1082f3d4448SNicolas Bonnefon
1092f3d4448SNicolas Bonnefon    INCLUDEPATH += $$BOOST_PATH
1103e90fb01SNicolas Bonnefon}
1113e90fb01SNicolas Bonnefon
112bb02e0acSNicolas BonnefonFORMS += src/optionsdialog.ui
113bb02e0acSNicolas BonnefonFORMS += src/filtersdialog.ui
1149a361c77SNicolas Bonnefon
11536b4ae36SNicolas Bonnefon# For Windows icon
11636b4ae36SNicolas BonnefonRC_FILE = glogg.rc
1179a361c77SNicolas BonnefonRESOURCES = glogg.qrc
1189a361c77SNicolas Bonnefon
119458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available)
120458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) {
121458a6a73SNicolas Bonnefon    MARKDOWN += doc/documentation.markdown
122458a6a73SNicolas Bonnefon}
123458a6a73SNicolas Bonnefonelse {
124458a6a73SNicolas Bonnefon    message("markdown not found, HTML doc will not be generated")
125458a6a73SNicolas Bonnefon}
126458a6a73SNicolas Bonnefon
127458a6a73SNicolas Bonnefondoc_processor.name = markdown
128458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN
129458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html
130458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
131458a6a73SNicolas Bonnefon    sed -f finish.sed >${QMAKE_FILE_OUT}
132458a6a73SNicolas Bonnefon
133458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps
134458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files
135458a6a73SNicolas Bonnefon
136458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor
137458a6a73SNicolas Bonnefon
138b5a5d5faSNicolas Bonnefon# Install (for unix)
139fca14737SNicolas Bonnefonicon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
140fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png
141fca14737SNicolas Bonnefon
142fca14737SNicolas Bonnefonicon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
143fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png
144fca14737SNicolas Bonnefon
1454863be78SNicolas Bonnefonicon_svg.path  = $$PREFIX/share/icons/hicolor/scalable/apps
1464863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg
1474863be78SNicolas Bonnefon
148fca14737SNicolas Bonnefondoc.path  = $$PREFIX/share/doc/glogg
149458a6a73SNicolas Bonnefondoc.files += README COPYING
150fca14737SNicolas Bonnefon
151fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications
15276bf9e67SNicolas Bonnefondesktop.files = glogg.desktop
153fca14737SNicolas Bonnefon
154b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin
1554863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop
156b5a5d5faSNicolas Bonnefon
157b5a5d5faSNicolas Bonnefon# Build directories
158ca3430bfSNicolas BonnefonCONFIG(debug, debug|release) {
159ca3430bfSNicolas Bonnefon    DESTDIR = debug
160ca3430bfSNicolas Bonnefon} else {
161ca3430bfSNicolas Bonnefon    DESTDIR = release
162ca3430bfSNicolas Bonnefon}
1639a361c77SNicolas Bonnefon
164ca3430bfSNicolas BonnefonOBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared
165ca3430bfSNicolas BonnefonMOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared
166ca3430bfSNicolas BonnefonUI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared
167ca3430bfSNicolas Bonnefon
168ca3430bfSNicolas Bonnefon# Debug symbols even in release build
169ca3430bfSNicolas BonnefonQMAKE_CXXFLAGS = -g
170f1ff9ae1SNicolas Bonnefon
171c51eaa77SNicolas Bonnefon# Which compiler are we using
172e38396b0SNicolas Bonnefonsystem( $${QMAKE_CXX} --version | grep -e " 4\.[7-9]" ) {
173c51eaa77SNicolas Bonnefon    message ( "g++ version 4.7 or newer, supports C++11" )
174c51eaa77SNicolas Bonnefon    CONFIG += C++11
175c51eaa77SNicolas Bonnefon}
176c51eaa77SNicolas Bonnefonelse {
177e38396b0SNicolas Bonnefon    CONFIG += C++0x
178c51eaa77SNicolas Bonnefon}
179c51eaa77SNicolas Bonnefon
180867c74e5SNicolas Bonnefon# Extra compiler arguments
181867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++
182e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra
183c51eaa77SNicolas BonnefonC++0x:QMAKE_CXXFLAGS += -std=c++0x
184c51eaa77SNicolas BonnefonC++11:QMAKE_CXXFLAGS += -std=c++11
185867c74e5SNicolas Bonnefon
18664c49544SNicolas BonnefonGPROF {
18764c49544SNicolas Bonnefon    QMAKE_CXXFLAGS += -pg
18864c49544SNicolas Bonnefon    QMAKE_LFLAGS   += -pg
18964c49544SNicolas Bonnefon}
19064c49544SNicolas Bonnefon
19159d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) {
192ca3430bfSNicolas Bonnefon    CONFIG(debug, debug|release) {
193ca3430bfSNicolas Bonnefon        DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\"
194ca3430bfSNicolas Bonnefon    } else {
195ca3430bfSNicolas Bonnefon        DEFINES += FILELOG_MAX_LEVEL=\"logERROR\"
196ca3430bfSNicolas Bonnefon    }
19759d49dccSNicolas Bonnefon}
19859d49dccSNicolas Bonnefonelse {
19959d49dccSNicolas Bonnefon    message("Using specified log level: $$LOG_LEVEL")
20059d49dccSNicolas Bonnefon    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
20159d49dccSNicolas Bonnefon}
2029a361c77SNicolas Bonnefon
203b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"'
204ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) {
205afcc2cb7SNicolas Bonnefon    system([ -f .tarball-version ]) {
206afcc2cb7SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
207afcc2cb7SNicolas Bonnefon    }
208afcc2cb7SNicolas Bonnefon    else {
209b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
210b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
211b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
212b5a5d5faSNicolas Bonnefon    }
213afcc2cb7SNicolas Bonnefon}
214b5a5d5faSNicolas Bonnefonelse {
21521a1b6dcSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
216b5a5d5faSNicolas Bonnefon}
217458a6a73SNicolas Bonnefon
218