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