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