1# ------------------------------------------------- 2# glogg 3# ------------------------------------------------- 4 5# Debug builds: qmake CONFIG+=debug 6# Release builds: qmake 7 8TARGET = glogg 9TEMPLATE = app 10 11greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 12 13QT += dbus 14 15win32:Debug:CONFIG += console 16# Necessary when cross-compiling: 17win32:Release:QMAKE_LFLAGS += "-Wl,-subsystem,windows" 18 19# Input 20SOURCES += \ 21 src/main.cpp \ 22 src/session.cpp \ 23 src/data/abstractlogdata.cpp \ 24 src/data/logdata.cpp \ 25 src/data/logfiltereddata.cpp \ 26 src/data/logfiltereddataworkerthread.cpp \ 27 src/data/logdataworkerthread.cpp \ 28 src/mainwindow.cpp \ 29 src/crawlerwidget.cpp \ 30 src/abstractlogview.cpp \ 31 src/logmainview.cpp \ 32 src/filteredview.cpp \ 33 src/optionsdialog.cpp \ 34 src/persistentinfo.cpp \ 35 src/configuration.cpp \ 36 src/filtersdialog.cpp \ 37 src/filterset.cpp \ 38 src/savedsearches.cpp \ 39 src/infoline.cpp \ 40 src/menuactiontooltipbehavior.cpp \ 41 src/filewatcher.cpp \ 42 src/selection.cpp \ 43 src/quickfind.cpp \ 44 src/quickfindpattern.cpp \ 45 src/quickfindwidget.cpp \ 46 src/sessioninfo.cpp \ 47 src/recentfiles.cpp \ 48 src/overview.cpp \ 49 src/overviewwidget.cpp \ 50 src/marks.cpp \ 51 src/quickfindmux.cpp \ 52 src/signalmux.cpp \ 53 src/tabbedcrawlerwidget.cpp \ 54 src/dbusexternalcom.cpp 55 56INCLUDEPATH += src/ 57 58HEADERS += \ 59 src/data/abstractlogdata.h \ 60 src/data/logdata.h \ 61 src/data/logfiltereddata.h \ 62 src/data/logfiltereddataworkerthread.h \ 63 src/data/logdataworkerthread.h \ 64 src/mainwindow.h \ 65 src/session.h \ 66 src/viewinterface.h \ 67 src/crawlerwidget.h \ 68 src/logmainview.h \ 69 src/log.h \ 70 src/filteredview.h \ 71 src/abstractlogview.h \ 72 src/optionsdialog.h \ 73 src/persistentinfo.h \ 74 src/configuration.h \ 75 src/filtersdialog.h \ 76 src/filterset.h \ 77 src/savedsearches.h \ 78 src/infoline.h \ 79 src/filewatcher.h \ 80 src/selection.h \ 81 src/quickfind.h \ 82 src/quickfindpattern.h \ 83 src/quickfindwidget.h \ 84 src/sessioninfo.h \ 85 src/persistable.h \ 86 src/recentfiles.h \ 87 src/menuactiontooltipbehavior.h \ 88 src/overview.h \ 89 src/overviewwidget.h \ 90 src/marks.h \ 91 src/qfnotifications.h \ 92 src/quickfindmux.h \ 93 src/signalmux.h \ 94 src/tabbedcrawlerwidget.h \ 95 src/loadingstatus.h \ 96 src/externalcom.h \ 97 src/dbusexternalcom.h 98 99isEmpty(BOOST_PATH) { 100 message(Building using system dynamic Boost libraries) 101 LIBS += -lboost_program_options 102} 103else { 104 message(Building using static Boost libraries at $$BOOST_PATH) 105 106 SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \ 107 $$BOOST_PATH/libs/smart_ptr/src/*.cpp 108 109 INCLUDEPATH += $$BOOST_PATH 110} 111 112FORMS += src/optionsdialog.ui 113FORMS += src/filtersdialog.ui 114 115# For Windows icon 116RC_FILE = glogg.rc 117RESOURCES = glogg.qrc 118 119# Build HTML documentation (if 'markdown' is available) 120system(type markdown >/dev/null) { 121 MARKDOWN += doc/documentation.markdown 122} 123else { 124 message("markdown not found, HTML doc will not be generated") 125} 126 127doc_processor.name = markdown 128doc_processor.input = MARKDOWN 129doc_processor.output = doc/${QMAKE_FILE_BASE}.html 130doc_processor.commands = markdown ${QMAKE_FILE_NAME} | \ 131 sed -f finish.sed >${QMAKE_FILE_OUT} 132 133doc_processor.CONFIG += target_predeps 134doc_processor.variable_out = doc.files 135 136QMAKE_EXTRA_COMPILERS += doc_processor 137 138# Install (for unix) 139icon16.path = $$PREFIX/share/icons/hicolor/16x16/apps 140icon16.files = images/hicolor/16x16/glogg.png 141 142icon32.path = $$PREFIX/share/icons/hicolor/32x32/apps 143icon32.files = images/hicolor/32x32/glogg.png 144 145icon_svg.path = $$PREFIX/share/icons/hicolor/scalable/apps 146icon_svg.files = images/hicolor/scalable/glogg.svg 147 148doc.path = $$PREFIX/share/doc/glogg 149doc.files += README COPYING 150 151desktop.path = $$PREFIX/share/applications 152desktop.files = glogg.desktop 153 154target.path = $$PREFIX/bin 155INSTALLS = target icon16 icon32 icon_svg doc desktop 156 157# Build directories 158CONFIG(debug, debug|release) { 159 DESTDIR = debug 160} else { 161 DESTDIR = release 162} 163 164OBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared 165MOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared 166UI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared 167 168# Debug symbols even in release build 169QMAKE_CXXFLAGS = -g 170 171# Which compiler are we using 172system( $${QMAKE_CXX} --version | grep -e " 4\.[7-9]" ) { 173 message ( "g++ version 4.7 or newer, supports C++11" ) 174 CONFIG += C++11 175} 176else { 177 CONFIG += C++0x 178} 179 180# Extra compiler arguments 181# QMAKE_CXXFLAGS += -Weffc++ 182QMAKE_CXXFLAGS += -Wextra 183C++0x:QMAKE_CXXFLAGS += -std=c++0x 184C++11:QMAKE_CXXFLAGS += -std=c++11 185 186GPROF { 187 QMAKE_CXXFLAGS += -pg 188 QMAKE_LFLAGS += -pg 189} 190 191isEmpty(LOG_LEVEL) { 192 CONFIG(debug, debug|release) { 193 DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\" 194 } else { 195 DEFINES += FILELOG_MAX_LEVEL=\"logERROR\" 196 } 197} 198else { 199 message("Using specified log level: $$LOG_LEVEL") 200 DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\" 201} 202 203# Official builds can be generated with `qmake VERSION="1.2.3"' 204isEmpty(VERSION):system(date >/dev/null) { 205 system([ -f .tarball-version ]) { 206 QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\" 207 } 208 else { 209 QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\" 210 QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\" 211 QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\" 212 } 213} 214else { 215 QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\" 216} 217 218