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