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