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