xref: /glogg/glogg.pro (revision 812146a8302488475ae27a1d22ae44a1379476a9)
1# -------------------------------------------------
2# glogg
3# -------------------------------------------------
4
5# Debug builds: qmake CONFIG+=debug
6# Release builds: qmake
7
8TARGET = glogg
9TEMPLATE = app
10
11greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
12
13win32:Debug:CONFIG += console
14# Necessary when cross-compiling:
15win32:Release:QMAKE_LFLAGS += "-Wl,-subsystem,windows"
16
17# Input
18SOURCES += \
19    src/main.cpp \
20    src/session.cpp \
21    src/data/abstractlogdata.cpp \
22    src/data/logdata.cpp \
23    src/data/logfiltereddata.cpp \
24    src/data/logfiltereddataworkerthread.cpp \
25    src/data/logdataworkerthread.cpp \
26    src/mainwindow.cpp \
27    src/crawlerwidget.cpp \
28    src/abstractlogview.cpp \
29    src/logmainview.cpp \
30    src/filteredview.cpp \
31    src/optionsdialog.cpp \
32    src/persistentinfo.cpp \
33    src/configuration.cpp \
34    src/filtersdialog.cpp \
35    src/filterset.cpp \
36    src/savedsearches.cpp \
37    src/infoline.cpp \
38    src/menuactiontooltipbehavior.cpp \
39    src/filewatcher.cpp \
40    src/selection.cpp \
41    src/quickfind.cpp \
42    src/quickfindpattern.cpp \
43    src/quickfindwidget.cpp \
44    src/sessioninfo.cpp \
45    src/recentfiles.cpp \
46    src/overview.cpp \
47    src/overviewwidget.cpp \
48    src/marks.cpp \
49    src/quickfindmux.cpp \
50    src/signalmux.cpp \
51    src/tabbedcrawlerwidget.cpp
52
53INCLUDEPATH += src/
54
55HEADERS += \
56    src/data/abstractlogdata.h \
57    src/data/logdata.h \
58    src/data/logfiltereddata.h \
59    src/data/logfiltereddataworkerthread.h \
60    src/data/logdataworkerthread.h \
61    src/mainwindow.h \
62    src/session.h \
63    src/viewinterface.h \
64    src/crawlerwidget.h \
65    src/logmainview.h \
66    src/log.h \
67    src/filteredview.h \
68    src/abstractlogview.h \
69    src/optionsdialog.h \
70    src/persistentinfo.h \
71    src/configuration.h \
72    src/filtersdialog.h \
73    src/filterset.h \
74    src/savedsearches.h \
75    src/infoline.h \
76    src/filewatcher.h \
77    src/selection.h \
78    src/quickfind.h \
79    src/quickfindpattern.h \
80    src/quickfindwidget.h \
81    src/sessioninfo.h \
82    src/persistable.h \
83    src/recentfiles.h \
84    src/menuactiontooltipbehavior.h \
85    src/overview.h \
86    src/overviewwidget.h \
87    src/marks.h \
88    src/qfnotifications.h \
89    src/quickfindmux.h \
90    src/signalmux.h \
91    src/tabbedcrawlerwidget.h \
92    src/loadingstatus.h
93
94isEmpty(BOOST_PATH) {
95    message(Building using system dynamic Boost libraries)
96    LIBS += -lboost_program_options
97}
98else {
99    message(Building using static Boost libraries at $$BOOST_PATH)
100
101    SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \
102        $$BOOST_PATH/libs/smart_ptr/src/*.cpp
103
104    INCLUDEPATH += $$BOOST_PATH
105}
106
107FORMS += src/optionsdialog.ui
108FORMS += src/filtersdialog.ui
109
110# For Windows icon
111RC_FILE = glogg.rc
112RESOURCES = glogg.qrc
113
114# Build HTML documentation (if 'markdown' is available)
115system(type markdown >/dev/null) {
116    MARKDOWN += doc/documentation.markdown
117}
118else {
119    message("markdown not found, HTML doc will not be generated")
120}
121
122doc_processor.name = markdown
123doc_processor.input = MARKDOWN
124doc_processor.output = doc/${QMAKE_FILE_BASE}.html
125doc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
126    sed -f finish.sed >${QMAKE_FILE_OUT}
127
128doc_processor.CONFIG += target_predeps
129doc_processor.variable_out = doc.files
130
131QMAKE_EXTRA_COMPILERS += doc_processor
132
133# Install (for unix)
134icon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
135icon16.files = images/hicolor/16x16/glogg.png
136
137icon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
138icon32.files = images/hicolor/32x32/glogg.png
139
140icon_svg.path  = $$PREFIX/share/icons/hicolor/scalable/apps
141icon_svg.files = images/hicolor/scalable/glogg.svg
142
143doc.path  = $$PREFIX/share/doc/glogg
144doc.files += README COPYING
145
146desktop.path = $$PREFIX/share/applications
147desktop.files = glogg.desktop
148
149target.path = $$PREFIX/bin
150INSTALLS = target icon16 icon32 icon_svg doc desktop
151
152# Build directories
153CONFIG(debug, debug|release) {
154    DESTDIR = debug
155} else {
156    DESTDIR = release
157}
158
159OBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared
160MOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared
161UI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared
162
163# Debug symbols even in release build
164QMAKE_CXXFLAGS = -g
165
166# Which compiler are we using
167system( $${QMAKE_CXX} --version | grep -e " 4\.[7-9]" ) {
168    message ( "g++ version 4.7 or newer, supports C++11" )
169    CONFIG += C++11
170}
171else {
172    CONFIG += C++0x
173}
174
175# Extra compiler arguments
176# QMAKE_CXXFLAGS += -Weffc++
177QMAKE_CXXFLAGS += -Wextra
178C++0x:QMAKE_CXXFLAGS += -std=c++0x
179C++11:QMAKE_CXXFLAGS += -std=c++11
180
181GPROF {
182    QMAKE_CXXFLAGS += -pg
183    QMAKE_LFLAGS   += -pg
184}
185
186isEmpty(LOG_LEVEL) {
187    CONFIG(debug, debug|release) {
188        DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\"
189    } else {
190        DEFINES += FILELOG_MAX_LEVEL=\"logERROR\"
191    }
192}
193else {
194    message("Using specified log level: $$LOG_LEVEL")
195    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
196}
197
198# Official builds can be generated with `qmake VERSION="1.2.3"'
199isEmpty(VERSION):system(date >/dev/null) {
200    system([ -f .tarball-version ]) {
201        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
202    }
203    else {
204        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
205        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
206        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
207    }
208}
209else {
210    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
211}
212
213