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