xref: /glogg/glogg.pro (revision a0230d5f349b97fca1756349bc517c34f89ef23a)
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
37HEADERS += version.h \
38    mainwindow.h \
39    crawlerwidget.h \
40    logmainview.h \
41    log.h \
42    filteredview.h \
43    abstractlogdata.h \
44    logdata.h \
45    logfiltereddata.h \
46    abstractlogview.h \
47    optionsdialog.h \
48    persistentinfo.h \
49    configuration.h \
50    filtersdialog.h \
51    filterset.h \
52    savedsearches.h \
53    infoline.h \
54    logdataworkerthread.h \
55    logfiltereddataworkerthread.h \
56    filewatcher.h \
57    selection.h \
58    quickfind.h \
59    quickfindpattern.h \
60    quickfindwidget.h \
61    sessioninfo.h \
62    persistable.h
63
64isEmpty(BOOST_PATH) {
65    message(Building using system dynamic Boost libraries)
66    LIBS += -lboost_program_options -L$HOME/lib/
67}
68else {
69    message(Building using static Boost libraries at $$BOOST_PATH)
70
71    SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \
72        $$BOOST_PATH/libs/detail/*.cpp \
73        $$BOOST_PATH/libs/smart_ptr/src/*.cpp
74
75    INCLUDEPATH += $$BOOST_PATH
76}
77
78FORMS += optionsdialog.ui
79
80greaterThan(QT_VERSION, "4.4.0") {
81    FORMS += filtersdialog.ui
82}
83else {
84    message(Using old FiltersDialog)
85    FORMS += filtersdialog_old.ui
86}
87
88# For Windows icon
89RC_FILE = glogg.rc
90RESOURCES = glogg.qrc
91
92# Build HTML documentation (if 'markdown' is available)
93system(type markdown >/dev/null) {
94    MARKDOWN += doc/documentation.markdown
95}
96else {
97    message("markdown not found, HTML doc will not be generated")
98}
99
100doc_processor.name = markdown
101doc_processor.input = MARKDOWN
102doc_processor.output = doc/${QMAKE_FILE_BASE}.html
103doc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
104    sed -f finish.sed >${QMAKE_FILE_OUT}
105
106doc_processor.CONFIG += target_predeps
107doc_processor.variable_out = doc.files
108
109QMAKE_EXTRA_COMPILERS += doc_processor
110
111# Install (for unix)
112icon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
113icon16.files = images/hicolor/16x16/glogg.png
114
115icon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
116icon32.files = images/hicolor/32x32/glogg.png
117
118doc.path  = $$PREFIX/share/doc/glogg
119doc.files += README COPYING
120
121desktop.path = $$PREFIX/share/applications
122desktop.files = glogg.desktop
123
124target.path = $$PREFIX/bin
125INSTALLS = target icon16 icon32 doc desktop
126
127# Build directories
128debug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
129release:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
130debug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared
131release:MOC_DIR = $${OUT_PWD}/.moc/release-shared
132
133# Debug symbols in debug builds
134debug:QMAKE_CXXFLAGS += -g
135
136isEmpty(LOG_LEVEL) {
137    Release:DEFINES += FILELOG_MAX_LEVEL=\"logERROR\"
138    Debug:DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\"
139}
140else {
141    message("Using specified log level: $$LOG_LEVEL")
142    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
143}
144
145# Official builds can be generated with `qmake VERSION="1.2.3"'
146isEmpty(VERSION):system(date >/dev/null) {
147    system([ -f .tarball-version ]) {
148        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
149    }
150    else {
151        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
152        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
153        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
154    }
155}
156else {
157    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
158}
159
160