xref: /glogg/glogg.pro (revision 093a1bf60100ad8e1e7796bd71e79d000d46c3ec)
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 \
46313a820fSNicolas Bonnefon    src/signalmux.cpp
47bb02e0acSNicolas Bonnefon
48bb02e0acSNicolas BonnefonINCLUDEPATH += src/
499a361c77SNicolas Bonnefon
506e94dd7aSNicolas BonnefonHEADERS += \
51bb02e0acSNicolas Bonnefon    src/data/abstractlogdata.h \
52bb02e0acSNicolas Bonnefon    src/data/logdata.h \
53bb02e0acSNicolas Bonnefon    src/data/logfiltereddata.h \
54bb02e0acSNicolas Bonnefon    src/data/logfiltereddataworkerthread.h \
55bb02e0acSNicolas Bonnefon    src/data/logdataworkerthread.h \
56bb02e0acSNicolas Bonnefon    src/mainwindow.h \
57d96f3f21SNicolas Bonnefon    src/session.h \
58d96f3f21SNicolas Bonnefon    src/viewinterface.h \
59bb02e0acSNicolas Bonnefon    src/crawlerwidget.h \
60bb02e0acSNicolas Bonnefon    src/logmainview.h \
61bb02e0acSNicolas Bonnefon    src/log.h \
62bb02e0acSNicolas Bonnefon    src/filteredview.h \
63bb02e0acSNicolas Bonnefon    src/abstractlogview.h \
64bb02e0acSNicolas Bonnefon    src/optionsdialog.h \
65bb02e0acSNicolas Bonnefon    src/persistentinfo.h \
66bb02e0acSNicolas Bonnefon    src/configuration.h \
67bb02e0acSNicolas Bonnefon    src/filtersdialog.h \
68bb02e0acSNicolas Bonnefon    src/filterset.h \
69bb02e0acSNicolas Bonnefon    src/savedsearches.h \
70bb02e0acSNicolas Bonnefon    src/infoline.h \
71bb02e0acSNicolas Bonnefon    src/filewatcher.h \
72bb02e0acSNicolas Bonnefon    src/selection.h \
73bb02e0acSNicolas Bonnefon    src/quickfind.h \
74bb02e0acSNicolas Bonnefon    src/quickfindpattern.h \
75bb02e0acSNicolas Bonnefon    src/quickfindwidget.h \
76bb02e0acSNicolas Bonnefon    src/sessioninfo.h \
77bb02e0acSNicolas Bonnefon    src/persistable.h \
78bb02e0acSNicolas Bonnefon    src/recentfiles.h \
79bb02e0acSNicolas Bonnefon    src/menuactiontooltipbehavior.h \
80bb02e0acSNicolas Bonnefon    src/overview.h \
81bb02e0acSNicolas Bonnefon    src/overviewwidget.h \
82bb02e0acSNicolas Bonnefon    src/marks.h \
83bb02e0acSNicolas Bonnefon    src/qfnotifications.h \
84313a820fSNicolas Bonnefon    src/quickfindmux.h \
85*093a1bf6SNicolas Bonnefon    src/signalmux.h \
86*093a1bf6SNicolas Bonnefon    src/tabbedcrawlerwidget.h
879a361c77SNicolas Bonnefon
882f3d4448SNicolas BonnefonisEmpty(BOOST_PATH) {
892f3d4448SNicolas Bonnefon    message(Building using system dynamic Boost libraries)
904b0730ffSNicolas Bonnefon    LIBS += -lboost_program_options
913e90fb01SNicolas Bonnefon}
923e90fb01SNicolas Bonnefonelse {
932f3d4448SNicolas Bonnefon    message(Building using static Boost libraries at $$BOOST_PATH)
942f3d4448SNicolas Bonnefon
952f3d4448SNicolas Bonnefon    SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \
962f3d4448SNicolas Bonnefon        $$BOOST_PATH/libs/smart_ptr/src/*.cpp
972f3d4448SNicolas Bonnefon
982f3d4448SNicolas Bonnefon    INCLUDEPATH += $$BOOST_PATH
993e90fb01SNicolas Bonnefon}
1003e90fb01SNicolas Bonnefon
101bb02e0acSNicolas BonnefonFORMS += src/optionsdialog.ui
102bb02e0acSNicolas BonnefonFORMS += src/filtersdialog.ui
1039a361c77SNicolas Bonnefon
10436b4ae36SNicolas Bonnefon# For Windows icon
10536b4ae36SNicolas BonnefonRC_FILE = glogg.rc
1069a361c77SNicolas BonnefonRESOURCES = glogg.qrc
1079a361c77SNicolas Bonnefon
108458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available)
109458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) {
110458a6a73SNicolas Bonnefon    MARKDOWN += doc/documentation.markdown
111458a6a73SNicolas Bonnefon}
112458a6a73SNicolas Bonnefonelse {
113458a6a73SNicolas Bonnefon    message("markdown not found, HTML doc will not be generated")
114458a6a73SNicolas Bonnefon}
115458a6a73SNicolas Bonnefon
116458a6a73SNicolas Bonnefondoc_processor.name = markdown
117458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN
118458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html
119458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
120458a6a73SNicolas Bonnefon    sed -f finish.sed >${QMAKE_FILE_OUT}
121458a6a73SNicolas Bonnefon
122458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps
123458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files
124458a6a73SNicolas Bonnefon
125458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor
126458a6a73SNicolas Bonnefon
127b5a5d5faSNicolas Bonnefon# Install (for unix)
128fca14737SNicolas Bonnefonicon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
129fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png
130fca14737SNicolas Bonnefon
131fca14737SNicolas Bonnefonicon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
132fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png
133fca14737SNicolas Bonnefon
1344863be78SNicolas Bonnefonicon_svg.path  = $$PREFIX/share/icons/hicolor/scalable/apps
1354863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg
1364863be78SNicolas Bonnefon
137fca14737SNicolas Bonnefondoc.path  = $$PREFIX/share/doc/glogg
138458a6a73SNicolas Bonnefondoc.files += README COPYING
139fca14737SNicolas Bonnefon
140fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications
14176bf9e67SNicolas Bonnefondesktop.files = glogg.desktop
142fca14737SNicolas Bonnefon
143b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin
1444863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop
145b5a5d5faSNicolas Bonnefon
146b5a5d5faSNicolas Bonnefon# Build directories
1479a361c77SNicolas Bonnefondebug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
1489a361c77SNicolas Bonnefonrelease:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
1499a361c77SNicolas Bonnefondebug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared
1509a361c77SNicolas Bonnefonrelease:MOC_DIR = $${OUT_PWD}/.moc/release-shared
151821cac88SNicolas Bonnefondebug:UI_DIR = $${OUT_PWD}/.ui/debug-shared
152821cac88SNicolas Bonnefonrelease:UI_DIR = $${OUT_PWD}/.ui/release-shared
1539a361c77SNicolas Bonnefon
154f1ff9ae1SNicolas Bonnefon# Debug symbols in debug builds
155f1ff9ae1SNicolas Bonnefondebug:QMAKE_CXXFLAGS += -g
156f1ff9ae1SNicolas Bonnefon
157c51eaa77SNicolas Bonnefon# Which compiler are we using
158c51eaa77SNicolas Bonnefonsystem( g++ --version | grep -e " 4\.6" ) {
159c51eaa77SNicolas Bonnefon    message ( "g++ version < 4.7, supports C++0x" )
160c51eaa77SNicolas Bonnefon    CONFIG += C++0x
161c51eaa77SNicolas Bonnefon}
162c51eaa77SNicolas Bonnefonelse {
163c51eaa77SNicolas Bonnefon    system( g++ --version | grep -e " 4\.[7-9]" ) {
164c51eaa77SNicolas Bonnefon        message ( "g++ version 4.7 or newer, supports C++11" )
165c51eaa77SNicolas Bonnefon        CONFIG += C++11
166c51eaa77SNicolas Bonnefon    }
167c51eaa77SNicolas Bonnefon    else {
168c51eaa77SNicolas Bonnefon        error ( "glogg requires g++ version 4.6 or later" )
169c51eaa77SNicolas Bonnefon    }
170c51eaa77SNicolas Bonnefon}
171c51eaa77SNicolas Bonnefon
172867c74e5SNicolas Bonnefon# Extra compiler arguments
173867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++
174e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra
175c51eaa77SNicolas BonnefonC++0x:QMAKE_CXXFLAGS += -std=c++0x
176c51eaa77SNicolas BonnefonC++11:QMAKE_CXXFLAGS += -std=c++11
177867c74e5SNicolas Bonnefon
17864c49544SNicolas BonnefonGPROF {
17964c49544SNicolas Bonnefon    QMAKE_CXXFLAGS += -pg
18064c49544SNicolas Bonnefon    QMAKE_LFLAGS   += -pg
18164c49544SNicolas Bonnefon}
18264c49544SNicolas Bonnefon
18359d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) {
1849a361c77SNicolas Bonnefon    Release:DEFINES += FILELOG_MAX_LEVEL=\"logERROR\"
185658425f1SNicolas Bonnefon    Debug:DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\"
18659d49dccSNicolas Bonnefon}
18759d49dccSNicolas Bonnefonelse {
18859d49dccSNicolas Bonnefon    message("Using specified log level: $$LOG_LEVEL")
18959d49dccSNicolas Bonnefon    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
19059d49dccSNicolas Bonnefon}
1919a361c77SNicolas Bonnefon
192b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"'
193ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) {
194afcc2cb7SNicolas Bonnefon    system([ -f .tarball-version ]) {
195afcc2cb7SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
196afcc2cb7SNicolas Bonnefon    }
197afcc2cb7SNicolas Bonnefon    else {
198b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
199b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
200b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
201b5a5d5faSNicolas Bonnefon    }
202afcc2cb7SNicolas Bonnefon}
203b5a5d5faSNicolas Bonnefonelse {
20421a1b6dcSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
205b5a5d5faSNicolas Bonnefon}
206458a6a73SNicolas Bonnefon
207