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