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