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