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