xref: /glogg/glogg.pro (revision ca3430bffaf64e5246a3341876e7536085346957)
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
93isEmpty(BOOST_PATH) {
94    message(Building using system dynamic Boost libraries)
95    LIBS += -lboost_program_options
96}
97else {
98    message(Building using static Boost libraries at $$BOOST_PATH)
99
100    SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \
101        $$BOOST_PATH/libs/smart_ptr/src/*.cpp
102
103    INCLUDEPATH += $$BOOST_PATH
104}
105
106FORMS += src/optionsdialog.ui
107FORMS += src/filtersdialog.ui
108
109# For Windows icon
110RC_FILE = glogg.rc
111RESOURCES = glogg.qrc
112
113# Build HTML documentation (if 'markdown' is available)
114system(type markdown >/dev/null) {
115    MARKDOWN += doc/documentation.markdown
116}
117else {
118    message("markdown not found, HTML doc will not be generated")
119}
120
121doc_processor.name = markdown
122doc_processor.input = MARKDOWN
123doc_processor.output = doc/${QMAKE_FILE_BASE}.html
124doc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
125    sed -f finish.sed >${QMAKE_FILE_OUT}
126
127doc_processor.CONFIG += target_predeps
128doc_processor.variable_out = doc.files
129
130QMAKE_EXTRA_COMPILERS += doc_processor
131
132# Install (for unix)
133icon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
134icon16.files = images/hicolor/16x16/glogg.png
135
136icon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
137icon32.files = images/hicolor/32x32/glogg.png
138
139icon_svg.path  = $$PREFIX/share/icons/hicolor/scalable/apps
140icon_svg.files = images/hicolor/scalable/glogg.svg
141
142doc.path  = $$PREFIX/share/doc/glogg
143doc.files += README COPYING
144
145desktop.path = $$PREFIX/share/applications
146desktop.files = glogg.desktop
147
148target.path = $$PREFIX/bin
149INSTALLS = target icon16 icon32 icon_svg doc desktop
150
151# Build directories
152CONFIG(debug, debug|release) {
153    DESTDIR = debug
154} else {
155    DESTDIR = release
156}
157
158OBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared
159MOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared
160UI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared
161
162# Debug symbols even in release build
163QMAKE_CXXFLAGS = -g
164
165# Which compiler are we using
166system( $${QMAKE_CXX} --version | grep -e " 4\.[7-9]" ) {
167    message ( "g++ version 4.7 or newer, supports C++11" )
168    CONFIG += C++11
169}
170else {
171    CONFIG += C++0x
172}
173
174# Extra compiler arguments
175# QMAKE_CXXFLAGS += -Weffc++
176QMAKE_CXXFLAGS += -Wextra
177C++0x:QMAKE_CXXFLAGS += -std=c++0x
178C++11:QMAKE_CXXFLAGS += -std=c++11
179
180GPROF {
181    QMAKE_CXXFLAGS += -pg
182    QMAKE_LFLAGS   += -pg
183}
184
185isEmpty(LOG_LEVEL) {
186    CONFIG(debug, debug|release) {
187        DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\"
188    } else {
189        DEFINES += FILELOG_MAX_LEVEL=\"logERROR\"
190    }
191}
192else {
193    message("Using specified log level: $$LOG_LEVEL")
194    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
195}
196
197# Official builds can be generated with `qmake VERSION="1.2.3"'
198isEmpty(VERSION):system(date >/dev/null) {
199    system([ -f .tarball-version ]) {
200        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
201    }
202    else {
203        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
204        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
205        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
206    }
207}
208else {
209    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
210}
211
212