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