xref: /glogg/glogg.pro (revision 333b2889af311485dd0cd8ea2e394af76455e71d)
19a361c77SNicolas Bonnefon# -------------------------------------------------
29a361c77SNicolas Bonnefon# glogg
39a361c77SNicolas Bonnefon# -------------------------------------------------
49a361c77SNicolas BonnefonTARGET = glogg
59a361c77SNicolas BonnefonTEMPLATE = app
69a361c77SNicolas Bonnefon
7eb6a8f99SNicolas BonnefongreaterThan(QT_MAJOR_VERSION, 4): QT += widgets
8eb6a8f99SNicolas Bonnefon
99a361c77SNicolas Bonnefonwin32:Debug:CONFIG += console
103597d419SNicolas Bonnefon# Necessary when cross-compiling:
113597d419SNicolas Bonnefonwin32:Release:QMAKE_LFLAGS += "-Wl,-subsystem,windows"
129a361c77SNicolas Bonnefon
139a361c77SNicolas Bonnefon# Input
14bb02e0acSNicolas BonnefonSOURCES += \
15bb02e0acSNicolas Bonnefon    src/main.cpp \
16d96f3f21SNicolas Bonnefon    src/session.cpp \
17bb02e0acSNicolas Bonnefon    src/data/abstractlogdata.cpp \
18bb02e0acSNicolas Bonnefon    src/data/logdata.cpp \
19bb02e0acSNicolas Bonnefon    src/data/logfiltereddata.cpp \
20bb02e0acSNicolas Bonnefon    src/data/logfiltereddataworkerthread.cpp \
21bb02e0acSNicolas Bonnefon    src/data/logdataworkerthread.cpp \
22bb02e0acSNicolas Bonnefon    src/mainwindow.cpp \
23bb02e0acSNicolas Bonnefon    src/crawlerwidget.cpp \
24bb02e0acSNicolas Bonnefon    src/abstractlogview.cpp \
25bb02e0acSNicolas Bonnefon    src/logmainview.cpp \
26bb02e0acSNicolas Bonnefon    src/filteredview.cpp \
27bb02e0acSNicolas Bonnefon    src/optionsdialog.cpp \
28bb02e0acSNicolas Bonnefon    src/persistentinfo.cpp \
29bb02e0acSNicolas Bonnefon    src/configuration.cpp \
30bb02e0acSNicolas Bonnefon    src/filtersdialog.cpp \
31bb02e0acSNicolas Bonnefon    src/filterset.cpp \
32bb02e0acSNicolas Bonnefon    src/savedsearches.cpp \
33bb02e0acSNicolas Bonnefon    src/infoline.cpp \
34bb02e0acSNicolas Bonnefon    src/menuactiontooltipbehavior.cpp \
35bb02e0acSNicolas Bonnefon    src/filewatcher.cpp \
36bb02e0acSNicolas Bonnefon    src/selection.cpp \
37bb02e0acSNicolas Bonnefon    src/quickfind.cpp \
38bb02e0acSNicolas Bonnefon    src/quickfindpattern.cpp \
39bb02e0acSNicolas Bonnefon    src/quickfindwidget.cpp \
40bb02e0acSNicolas Bonnefon    src/sessioninfo.cpp \
41bb02e0acSNicolas Bonnefon    src/recentfiles.cpp \
42bb02e0acSNicolas Bonnefon    src/overview.cpp \
43bb02e0acSNicolas Bonnefon    src/overviewwidget.cpp \
44bb02e0acSNicolas Bonnefon    src/marks.cpp \
45313a820fSNicolas Bonnefon    src/quickfindmux.cpp \
46*333b2889SNicolas Bonnefon    src/signalmux.cpp \
47*333b2889SNicolas Bonnefon    src/tabbedcrawlerwidget.cpp
48bb02e0acSNicolas Bonnefon
49bb02e0acSNicolas BonnefonINCLUDEPATH += src/
509a361c77SNicolas Bonnefon
516e94dd7aSNicolas BonnefonHEADERS += \
52bb02e0acSNicolas Bonnefon    src/data/abstractlogdata.h \
53bb02e0acSNicolas Bonnefon    src/data/logdata.h \
54bb02e0acSNicolas Bonnefon    src/data/logfiltereddata.h \
55bb02e0acSNicolas Bonnefon    src/data/logfiltereddataworkerthread.h \
56bb02e0acSNicolas Bonnefon    src/data/logdataworkerthread.h \
57bb02e0acSNicolas Bonnefon    src/mainwindow.h \
58d96f3f21SNicolas Bonnefon    src/session.h \
59d96f3f21SNicolas Bonnefon    src/viewinterface.h \
60bb02e0acSNicolas Bonnefon    src/crawlerwidget.h \
61bb02e0acSNicolas Bonnefon    src/logmainview.h \
62bb02e0acSNicolas Bonnefon    src/log.h \
63bb02e0acSNicolas Bonnefon    src/filteredview.h \
64bb02e0acSNicolas Bonnefon    src/abstractlogview.h \
65bb02e0acSNicolas Bonnefon    src/optionsdialog.h \
66bb02e0acSNicolas Bonnefon    src/persistentinfo.h \
67bb02e0acSNicolas Bonnefon    src/configuration.h \
68bb02e0acSNicolas Bonnefon    src/filtersdialog.h \
69bb02e0acSNicolas Bonnefon    src/filterset.h \
70bb02e0acSNicolas Bonnefon    src/savedsearches.h \
71bb02e0acSNicolas Bonnefon    src/infoline.h \
72bb02e0acSNicolas Bonnefon    src/filewatcher.h \
73bb02e0acSNicolas Bonnefon    src/selection.h \
74bb02e0acSNicolas Bonnefon    src/quickfind.h \
75bb02e0acSNicolas Bonnefon    src/quickfindpattern.h \
76bb02e0acSNicolas Bonnefon    src/quickfindwidget.h \
77bb02e0acSNicolas Bonnefon    src/sessioninfo.h \
78bb02e0acSNicolas Bonnefon    src/persistable.h \
79bb02e0acSNicolas Bonnefon    src/recentfiles.h \
80bb02e0acSNicolas Bonnefon    src/menuactiontooltipbehavior.h \
81bb02e0acSNicolas Bonnefon    src/overview.h \
82bb02e0acSNicolas Bonnefon    src/overviewwidget.h \
83bb02e0acSNicolas Bonnefon    src/marks.h \
84bb02e0acSNicolas Bonnefon    src/qfnotifications.h \
85313a820fSNicolas Bonnefon    src/quickfindmux.h \
86093a1bf6SNicolas Bonnefon    src/signalmux.h \
87093a1bf6SNicolas Bonnefon    src/tabbedcrawlerwidget.h
889a361c77SNicolas Bonnefon
892f3d4448SNicolas BonnefonisEmpty(BOOST_PATH) {
902f3d4448SNicolas Bonnefon    message(Building using system dynamic Boost libraries)
914b0730ffSNicolas Bonnefon    LIBS += -lboost_program_options
923e90fb01SNicolas Bonnefon}
933e90fb01SNicolas Bonnefonelse {
942f3d4448SNicolas Bonnefon    message(Building using static Boost libraries at $$BOOST_PATH)
952f3d4448SNicolas Bonnefon
962f3d4448SNicolas Bonnefon    SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \
972f3d4448SNicolas Bonnefon        $$BOOST_PATH/libs/smart_ptr/src/*.cpp
982f3d4448SNicolas Bonnefon
992f3d4448SNicolas Bonnefon    INCLUDEPATH += $$BOOST_PATH
1003e90fb01SNicolas Bonnefon}
1013e90fb01SNicolas Bonnefon
102bb02e0acSNicolas BonnefonFORMS += src/optionsdialog.ui
103bb02e0acSNicolas BonnefonFORMS += src/filtersdialog.ui
1049a361c77SNicolas Bonnefon
10536b4ae36SNicolas Bonnefon# For Windows icon
10636b4ae36SNicolas BonnefonRC_FILE = glogg.rc
1079a361c77SNicolas BonnefonRESOURCES = glogg.qrc
1089a361c77SNicolas Bonnefon
109458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available)
110458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) {
111458a6a73SNicolas Bonnefon    MARKDOWN += doc/documentation.markdown
112458a6a73SNicolas Bonnefon}
113458a6a73SNicolas Bonnefonelse {
114458a6a73SNicolas Bonnefon    message("markdown not found, HTML doc will not be generated")
115458a6a73SNicolas Bonnefon}
116458a6a73SNicolas Bonnefon
117458a6a73SNicolas Bonnefondoc_processor.name = markdown
118458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN
119458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html
120458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
121458a6a73SNicolas Bonnefon    sed -f finish.sed >${QMAKE_FILE_OUT}
122458a6a73SNicolas Bonnefon
123458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps
124458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files
125458a6a73SNicolas Bonnefon
126458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor
127458a6a73SNicolas Bonnefon
128b5a5d5faSNicolas Bonnefon# Install (for unix)
129fca14737SNicolas Bonnefonicon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
130fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png
131fca14737SNicolas Bonnefon
132fca14737SNicolas Bonnefonicon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
133fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png
134fca14737SNicolas Bonnefon
1354863be78SNicolas Bonnefonicon_svg.path  = $$PREFIX/share/icons/hicolor/scalable/apps
1364863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg
1374863be78SNicolas Bonnefon
138fca14737SNicolas Bonnefondoc.path  = $$PREFIX/share/doc/glogg
139458a6a73SNicolas Bonnefondoc.files += README COPYING
140fca14737SNicolas Bonnefon
141fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications
14276bf9e67SNicolas Bonnefondesktop.files = glogg.desktop
143fca14737SNicolas Bonnefon
144b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin
1454863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop
146b5a5d5faSNicolas Bonnefon
147b5a5d5faSNicolas Bonnefon# Build directories
1489a361c77SNicolas Bonnefondebug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
1499a361c77SNicolas Bonnefonrelease:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
1509a361c77SNicolas Bonnefondebug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared
1519a361c77SNicolas Bonnefonrelease:MOC_DIR = $${OUT_PWD}/.moc/release-shared
152821cac88SNicolas Bonnefondebug:UI_DIR = $${OUT_PWD}/.ui/debug-shared
153821cac88SNicolas Bonnefonrelease:UI_DIR = $${OUT_PWD}/.ui/release-shared
1549a361c77SNicolas Bonnefon
155f1ff9ae1SNicolas Bonnefon# Debug symbols in debug builds
156e38396b0SNicolas Bonnefon# debug:QMAKE_CXXFLAGS += -g -O0
157f1ff9ae1SNicolas Bonnefon
158c51eaa77SNicolas Bonnefon# Which compiler are we using
159e38396b0SNicolas Bonnefonsystem( $${QMAKE_CXX} --version | grep -e " 4\.[7-9]" ) {
160c51eaa77SNicolas Bonnefon    message ( "g++ version 4.7 or newer, supports C++11" )
161c51eaa77SNicolas Bonnefon    CONFIG += C++11
162c51eaa77SNicolas Bonnefon}
163c51eaa77SNicolas Bonnefonelse {
164e38396b0SNicolas Bonnefon    CONFIG += C++0x
165c51eaa77SNicolas Bonnefon}
166c51eaa77SNicolas Bonnefon
167867c74e5SNicolas Bonnefon# Extra compiler arguments
168867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++
169e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra
170c51eaa77SNicolas BonnefonC++0x:QMAKE_CXXFLAGS += -std=c++0x
171c51eaa77SNicolas BonnefonC++11:QMAKE_CXXFLAGS += -std=c++11
172867c74e5SNicolas Bonnefon
17364c49544SNicolas BonnefonGPROF {
17464c49544SNicolas Bonnefon    QMAKE_CXXFLAGS += -pg
17564c49544SNicolas Bonnefon    QMAKE_LFLAGS   += -pg
17664c49544SNicolas Bonnefon}
17764c49544SNicolas Bonnefon
17859d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) {
1799a361c77SNicolas Bonnefon    Release:DEFINES += FILELOG_MAX_LEVEL=\"logERROR\"
180658425f1SNicolas Bonnefon    Debug:DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\"
18159d49dccSNicolas Bonnefon}
18259d49dccSNicolas Bonnefonelse {
18359d49dccSNicolas Bonnefon    message("Using specified log level: $$LOG_LEVEL")
18459d49dccSNicolas Bonnefon    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
18559d49dccSNicolas Bonnefon}
1869a361c77SNicolas Bonnefon
187b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"'
188ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) {
189afcc2cb7SNicolas Bonnefon    system([ -f .tarball-version ]) {
190afcc2cb7SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
191afcc2cb7SNicolas Bonnefon    }
192afcc2cb7SNicolas Bonnefon    else {
193b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
194b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
195b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
196b5a5d5faSNicolas Bonnefon    }
197afcc2cb7SNicolas Bonnefon}
198b5a5d5faSNicolas Bonnefonelse {
19921a1b6dcSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
200b5a5d5faSNicolas Bonnefon}
201458a6a73SNicolas Bonnefon
202