xref: /glogg/glogg.pro (revision eb6a8f99ea0d842b9a90838f7042320c340f5d56)
19a361c77SNicolas Bonnefon# -------------------------------------------------
29a361c77SNicolas Bonnefon# glogg
39a361c77SNicolas Bonnefon# -------------------------------------------------
49a361c77SNicolas BonnefonTARGET = glogg
59a361c77SNicolas BonnefonTEMPLATE = app
69a361c77SNicolas Bonnefon
7*eb6a8f99SNicolas BonnefongreaterThan(QT_MAJOR_VERSION, 4): QT += widgets
8*eb6a8f99SNicolas 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 \
16bb02e0acSNicolas Bonnefon    src/data/abstractlogdata.cpp \
17bb02e0acSNicolas Bonnefon    src/data/logdata.cpp \
18bb02e0acSNicolas Bonnefon    src/data/logfiltereddata.cpp \
19bb02e0acSNicolas Bonnefon    src/data/logfiltereddataworkerthread.cpp \
20bb02e0acSNicolas Bonnefon    src/data/logdataworkerthread.cpp \
21bb02e0acSNicolas Bonnefon    src/mainwindow.cpp \
22bb02e0acSNicolas Bonnefon    src/crawlerwidget.cpp \
23bb02e0acSNicolas Bonnefon    src/abstractlogview.cpp \
24bb02e0acSNicolas Bonnefon    src/logmainview.cpp \
25bb02e0acSNicolas Bonnefon    src/filteredview.cpp \
26bb02e0acSNicolas Bonnefon    src/optionsdialog.cpp \
27bb02e0acSNicolas Bonnefon    src/persistentinfo.cpp \
28bb02e0acSNicolas Bonnefon    src/configuration.cpp \
29bb02e0acSNicolas Bonnefon    src/filtersdialog.cpp \
30bb02e0acSNicolas Bonnefon    src/filterset.cpp \
31bb02e0acSNicolas Bonnefon    src/savedsearches.cpp \
32bb02e0acSNicolas Bonnefon    src/infoline.cpp \
33bb02e0acSNicolas Bonnefon    src/menuactiontooltipbehavior.cpp \
34bb02e0acSNicolas Bonnefon    src/filewatcher.cpp \
35bb02e0acSNicolas Bonnefon    src/selection.cpp \
36bb02e0acSNicolas Bonnefon    src/quickfind.cpp \
37bb02e0acSNicolas Bonnefon    src/quickfindpattern.cpp \
38bb02e0acSNicolas Bonnefon    src/quickfindwidget.cpp \
39bb02e0acSNicolas Bonnefon    src/sessioninfo.cpp \
40bb02e0acSNicolas Bonnefon    src/recentfiles.cpp \
41bb02e0acSNicolas Bonnefon    src/overview.cpp \
42bb02e0acSNicolas Bonnefon    src/overviewwidget.cpp \
43bb02e0acSNicolas Bonnefon    src/marks.cpp \
44bb02e0acSNicolas Bonnefon    src/quickfindmux.cpp
45bb02e0acSNicolas Bonnefon
46bb02e0acSNicolas BonnefonINCLUDEPATH += src/
479a361c77SNicolas Bonnefon
486e94dd7aSNicolas BonnefonHEADERS += \
49bb02e0acSNicolas Bonnefon    src/data/abstractlogdata.h \
50bb02e0acSNicolas Bonnefon    src/data/logdata.h \
51bb02e0acSNicolas Bonnefon    src/data/logfiltereddata.h \
52bb02e0acSNicolas Bonnefon    src/data/logfiltereddataworkerthread.h \
53bb02e0acSNicolas Bonnefon    src/data/logdataworkerthread.h \
54bb02e0acSNicolas Bonnefon    src/mainwindow.h \
55bb02e0acSNicolas Bonnefon    src/crawlerwidget.h \
56bb02e0acSNicolas Bonnefon    src/logmainview.h \
57bb02e0acSNicolas Bonnefon    src/log.h \
58bb02e0acSNicolas Bonnefon    src/filteredview.h \
59bb02e0acSNicolas Bonnefon    src/abstractlogview.h \
60bb02e0acSNicolas Bonnefon    src/optionsdialog.h \
61bb02e0acSNicolas Bonnefon    src/persistentinfo.h \
62bb02e0acSNicolas Bonnefon    src/configuration.h \
63bb02e0acSNicolas Bonnefon    src/filtersdialog.h \
64bb02e0acSNicolas Bonnefon    src/filterset.h \
65bb02e0acSNicolas Bonnefon    src/savedsearches.h \
66bb02e0acSNicolas Bonnefon    src/infoline.h \
67bb02e0acSNicolas Bonnefon    src/filewatcher.h \
68bb02e0acSNicolas Bonnefon    src/selection.h \
69bb02e0acSNicolas Bonnefon    src/quickfind.h \
70bb02e0acSNicolas Bonnefon    src/quickfindpattern.h \
71bb02e0acSNicolas Bonnefon    src/quickfindwidget.h \
72bb02e0acSNicolas Bonnefon    src/sessioninfo.h \
73bb02e0acSNicolas Bonnefon    src/persistable.h \
74bb02e0acSNicolas Bonnefon    src/recentfiles.h \
75bb02e0acSNicolas Bonnefon    src/menuactiontooltipbehavior.h \
76bb02e0acSNicolas Bonnefon    src/overview.h \
77bb02e0acSNicolas Bonnefon    src/overviewwidget.h \
78bb02e0acSNicolas Bonnefon    src/marks.h \
79bb02e0acSNicolas Bonnefon    src/qfnotifications.h \
80bb02e0acSNicolas Bonnefon    src/quickfindmux.h
819a361c77SNicolas Bonnefon
822f3d4448SNicolas BonnefonisEmpty(BOOST_PATH) {
832f3d4448SNicolas Bonnefon    message(Building using system dynamic Boost libraries)
844b0730ffSNicolas Bonnefon    LIBS += -lboost_program_options
853e90fb01SNicolas Bonnefon}
863e90fb01SNicolas Bonnefonelse {
872f3d4448SNicolas Bonnefon    message(Building using static Boost libraries at $$BOOST_PATH)
882f3d4448SNicolas Bonnefon
892f3d4448SNicolas Bonnefon    SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \
902f3d4448SNicolas Bonnefon        $$BOOST_PATH/libs/smart_ptr/src/*.cpp
912f3d4448SNicolas Bonnefon
922f3d4448SNicolas Bonnefon    INCLUDEPATH += $$BOOST_PATH
933e90fb01SNicolas Bonnefon}
943e90fb01SNicolas Bonnefon
95bb02e0acSNicolas BonnefonFORMS += src/optionsdialog.ui
96bb02e0acSNicolas BonnefonFORMS += src/filtersdialog.ui
979a361c77SNicolas Bonnefon
9836b4ae36SNicolas Bonnefon# For Windows icon
9936b4ae36SNicolas BonnefonRC_FILE = glogg.rc
1009a361c77SNicolas BonnefonRESOURCES = glogg.qrc
1019a361c77SNicolas Bonnefon
102458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available)
103458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) {
104458a6a73SNicolas Bonnefon    MARKDOWN += doc/documentation.markdown
105458a6a73SNicolas Bonnefon}
106458a6a73SNicolas Bonnefonelse {
107458a6a73SNicolas Bonnefon    message("markdown not found, HTML doc will not be generated")
108458a6a73SNicolas Bonnefon}
109458a6a73SNicolas Bonnefon
110458a6a73SNicolas Bonnefondoc_processor.name = markdown
111458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN
112458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html
113458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
114458a6a73SNicolas Bonnefon    sed -f finish.sed >${QMAKE_FILE_OUT}
115458a6a73SNicolas Bonnefon
116458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps
117458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files
118458a6a73SNicolas Bonnefon
119458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor
120458a6a73SNicolas Bonnefon
121b5a5d5faSNicolas Bonnefon# Install (for unix)
122fca14737SNicolas Bonnefonicon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
123fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png
124fca14737SNicolas Bonnefon
125fca14737SNicolas Bonnefonicon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
126fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png
127fca14737SNicolas Bonnefon
1284863be78SNicolas Bonnefonicon_svg.path  = $$PREFIX/share/icons/hicolor/scalable/apps
1294863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg
1304863be78SNicolas Bonnefon
131fca14737SNicolas Bonnefondoc.path  = $$PREFIX/share/doc/glogg
132458a6a73SNicolas Bonnefondoc.files += README COPYING
133fca14737SNicolas Bonnefon
134fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications
13576bf9e67SNicolas Bonnefondesktop.files = glogg.desktop
136fca14737SNicolas Bonnefon
137b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin
1384863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop
139b5a5d5faSNicolas Bonnefon
140b5a5d5faSNicolas Bonnefon# Build directories
1419a361c77SNicolas Bonnefondebug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
1429a361c77SNicolas Bonnefonrelease:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
1439a361c77SNicolas Bonnefondebug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared
1449a361c77SNicolas Bonnefonrelease:MOC_DIR = $${OUT_PWD}/.moc/release-shared
145821cac88SNicolas Bonnefondebug:UI_DIR = $${OUT_PWD}/.ui/debug-shared
146821cac88SNicolas Bonnefonrelease:UI_DIR = $${OUT_PWD}/.ui/release-shared
1479a361c77SNicolas Bonnefon
148f1ff9ae1SNicolas Bonnefon# Debug symbols in debug builds
149f1ff9ae1SNicolas Bonnefondebug:QMAKE_CXXFLAGS += -g
150f1ff9ae1SNicolas Bonnefon
151867c74e5SNicolas Bonnefon# Extra compiler arguments
152867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++
153e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra
154306d9ac9SNicolas BonnefonQMAKE_CXXFLAGS += -std=c++11
155867c74e5SNicolas Bonnefon
15664c49544SNicolas BonnefonGPROF {
15764c49544SNicolas Bonnefon    QMAKE_CXXFLAGS += -pg
15864c49544SNicolas Bonnefon    QMAKE_LFLAGS   += -pg
15964c49544SNicolas Bonnefon}
16064c49544SNicolas Bonnefon
16159d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) {
1629a361c77SNicolas Bonnefon    Release:DEFINES += FILELOG_MAX_LEVEL=\"logERROR\"
163658425f1SNicolas Bonnefon    Debug:DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\"
16459d49dccSNicolas Bonnefon}
16559d49dccSNicolas Bonnefonelse {
16659d49dccSNicolas Bonnefon    message("Using specified log level: $$LOG_LEVEL")
16759d49dccSNicolas Bonnefon    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
16859d49dccSNicolas Bonnefon}
1699a361c77SNicolas Bonnefon
170b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"'
171ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) {
172afcc2cb7SNicolas Bonnefon    system([ -f .tarball-version ]) {
173afcc2cb7SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
174afcc2cb7SNicolas Bonnefon    }
175afcc2cb7SNicolas Bonnefon    else {
176b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
177b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
178b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
179b5a5d5faSNicolas Bonnefon    }
180afcc2cb7SNicolas Bonnefon}
181b5a5d5faSNicolas Bonnefonelse {
18221a1b6dcSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
183b5a5d5faSNicolas Bonnefon}
184458a6a73SNicolas Bonnefon
185