1# ------------------------------------------------- 2# glogg 3# ------------------------------------------------- 4TARGET = glogg 5TEMPLATE = app 6 7greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 8 9win32:Debug:CONFIG += console 10# Necessary when cross-compiling: 11win32:Release:QMAKE_LFLAGS += "-Wl,-subsystem,windows" 12 13# Input 14SOURCES += \ 15 src/main.cpp \ 16 src/session.cpp \ 17 src/data/abstractlogdata.cpp \ 18 src/data/logdata.cpp \ 19 src/data/logfiltereddata.cpp \ 20 src/data/logfiltereddataworkerthread.cpp \ 21 src/data/logdataworkerthread.cpp \ 22 src/mainwindow.cpp \ 23 src/crawlerwidget.cpp \ 24 src/abstractlogview.cpp \ 25 src/logmainview.cpp \ 26 src/filteredview.cpp \ 27 src/optionsdialog.cpp \ 28 src/persistentinfo.cpp \ 29 src/configuration.cpp \ 30 src/filtersdialog.cpp \ 31 src/filterset.cpp \ 32 src/savedsearches.cpp \ 33 src/infoline.cpp \ 34 src/menuactiontooltipbehavior.cpp \ 35 src/filewatcher.cpp \ 36 src/selection.cpp \ 37 src/quickfind.cpp \ 38 src/quickfindpattern.cpp \ 39 src/quickfindwidget.cpp \ 40 src/sessioninfo.cpp \ 41 src/recentfiles.cpp \ 42 src/overview.cpp \ 43 src/overviewwidget.cpp \ 44 src/marks.cpp \ 45 src/quickfindmux.cpp \ 46 src/signalmux.cpp 47 48INCLUDEPATH += src/ 49 50HEADERS += \ 51 src/data/abstractlogdata.h \ 52 src/data/logdata.h \ 53 src/data/logfiltereddata.h \ 54 src/data/logfiltereddataworkerthread.h \ 55 src/data/logdataworkerthread.h \ 56 src/mainwindow.h \ 57 src/session.h \ 58 src/viewinterface.h \ 59 src/crawlerwidget.h \ 60 src/logmainview.h \ 61 src/log.h \ 62 src/filteredview.h \ 63 src/abstractlogview.h \ 64 src/optionsdialog.h \ 65 src/persistentinfo.h \ 66 src/configuration.h \ 67 src/filtersdialog.h \ 68 src/filterset.h \ 69 src/savedsearches.h \ 70 src/infoline.h \ 71 src/filewatcher.h \ 72 src/selection.h \ 73 src/quickfind.h \ 74 src/quickfindpattern.h \ 75 src/quickfindwidget.h \ 76 src/sessioninfo.h \ 77 src/persistable.h \ 78 src/recentfiles.h \ 79 src/menuactiontooltipbehavior.h \ 80 src/overview.h \ 81 src/overviewwidget.h \ 82 src/marks.h \ 83 src/qfnotifications.h \ 84 src/quickfindmux.h \ 85 src/signalmux.h 86 87isEmpty(BOOST_PATH) { 88 message(Building using system dynamic Boost libraries) 89 LIBS += -lboost_program_options 90} 91else { 92 message(Building using static Boost libraries at $$BOOST_PATH) 93 94 SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \ 95 $$BOOST_PATH/libs/smart_ptr/src/*.cpp 96 97 INCLUDEPATH += $$BOOST_PATH 98} 99 100FORMS += src/optionsdialog.ui 101FORMS += src/filtersdialog.ui 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 150debug:UI_DIR = $${OUT_PWD}/.ui/debug-shared 151release:UI_DIR = $${OUT_PWD}/.ui/release-shared 152 153# Debug symbols in debug builds 154debug:QMAKE_CXXFLAGS += -g 155 156# Which compiler are we using 157system( g++ --version | grep -e " 4\.6" ) { 158 message ( "g++ version < 4.7, supports C++0x" ) 159 CONFIG += C++0x 160} 161else { 162 system( g++ --version | grep -e " 4\.[7-9]" ) { 163 message ( "g++ version 4.7 or newer, supports C++11" ) 164 CONFIG += C++11 165 } 166 else { 167 error ( "glogg requires g++ version 4.6 or later" ) 168 } 169} 170 171# Extra compiler arguments 172# QMAKE_CXXFLAGS += -Weffc++ 173QMAKE_CXXFLAGS += -Wextra 174C++0x:QMAKE_CXXFLAGS += -std=c++0x 175C++11:QMAKE_CXXFLAGS += -std=c++11 176 177GPROF { 178 QMAKE_CXXFLAGS += -pg 179 QMAKE_LFLAGS += -pg 180} 181 182isEmpty(LOG_LEVEL) { 183 Release:DEFINES += FILELOG_MAX_LEVEL=\"logERROR\" 184 Debug:DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\" 185} 186else { 187 message("Using specified log level: $$LOG_LEVEL") 188 DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\" 189} 190 191# Official builds can be generated with `qmake VERSION="1.2.3"' 192isEmpty(VERSION):system(date >/dev/null) { 193 system([ -f .tarball-version ]) { 194 QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\" 195 } 196 else { 197 QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\" 198 QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\" 199 QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\" 200 } 201} 202else { 203 QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\" 204} 205 206