19a361c77SNicolas Bonnefon# ------------------------------------------------- 29a361c77SNicolas Bonnefon# glogg 39a361c77SNicolas Bonnefon# ------------------------------------------------- 49a361c77SNicolas BonnefonTARGET = glogg 59a361c77SNicolas BonnefonTEMPLATE = app 69a361c77SNicolas Bonnefon 7eb6a8f99SNicolas BonnefongreaterThan(QT_MAJOR_VERSION, 4): QT += widgets 8eb6a8f99SNicolas Bonnefon 99a361c77SNicolas Bonnefonwin32:Debug:CONFIG += console 103597d419SNicolas Bonnefon# Necessary when cross-compiling: 113597d419SNicolas Bonnefonwin32:Release:QMAKE_LFLAGS += "-Wl,-subsystem,windows" 129a361c77SNicolas Bonnefon 139a361c77SNicolas Bonnefon# Input 14bb02e0acSNicolas BonnefonSOURCES += \ 15bb02e0acSNicolas Bonnefon src/main.cpp \ 16d96f3f21SNicolas Bonnefon src/session.cpp \ 17bb02e0acSNicolas Bonnefon src/data/abstractlogdata.cpp \ 18bb02e0acSNicolas Bonnefon src/data/logdata.cpp \ 19bb02e0acSNicolas Bonnefon src/data/logfiltereddata.cpp \ 20bb02e0acSNicolas Bonnefon src/data/logfiltereddataworkerthread.cpp \ 21bb02e0acSNicolas Bonnefon src/data/logdataworkerthread.cpp \ 22bb02e0acSNicolas Bonnefon src/mainwindow.cpp \ 23bb02e0acSNicolas Bonnefon src/crawlerwidget.cpp \ 24bb02e0acSNicolas Bonnefon src/abstractlogview.cpp \ 25bb02e0acSNicolas Bonnefon src/logmainview.cpp \ 26bb02e0acSNicolas Bonnefon src/filteredview.cpp \ 27bb02e0acSNicolas Bonnefon src/optionsdialog.cpp \ 28bb02e0acSNicolas Bonnefon src/persistentinfo.cpp \ 29bb02e0acSNicolas Bonnefon src/configuration.cpp \ 30bb02e0acSNicolas Bonnefon src/filtersdialog.cpp \ 31bb02e0acSNicolas Bonnefon src/filterset.cpp \ 32bb02e0acSNicolas Bonnefon src/savedsearches.cpp \ 33bb02e0acSNicolas Bonnefon src/infoline.cpp \ 34bb02e0acSNicolas Bonnefon src/menuactiontooltipbehavior.cpp \ 35bb02e0acSNicolas Bonnefon src/filewatcher.cpp \ 36bb02e0acSNicolas Bonnefon src/selection.cpp \ 37bb02e0acSNicolas Bonnefon src/quickfind.cpp \ 38bb02e0acSNicolas Bonnefon src/quickfindpattern.cpp \ 39bb02e0acSNicolas Bonnefon src/quickfindwidget.cpp \ 40bb02e0acSNicolas Bonnefon src/sessioninfo.cpp \ 41bb02e0acSNicolas Bonnefon src/recentfiles.cpp \ 42bb02e0acSNicolas Bonnefon src/overview.cpp \ 43bb02e0acSNicolas Bonnefon src/overviewwidget.cpp \ 44bb02e0acSNicolas Bonnefon src/marks.cpp \ 45*313a820fSNicolas Bonnefon src/quickfindmux.cpp \ 46*313a820fSNicolas Bonnefon src/signalmux.cpp 47bb02e0acSNicolas Bonnefon 48bb02e0acSNicolas BonnefonINCLUDEPATH += src/ 499a361c77SNicolas Bonnefon 506e94dd7aSNicolas BonnefonHEADERS += \ 51bb02e0acSNicolas Bonnefon src/data/abstractlogdata.h \ 52bb02e0acSNicolas Bonnefon src/data/logdata.h \ 53bb02e0acSNicolas Bonnefon src/data/logfiltereddata.h \ 54bb02e0acSNicolas Bonnefon src/data/logfiltereddataworkerthread.h \ 55bb02e0acSNicolas Bonnefon src/data/logdataworkerthread.h \ 56bb02e0acSNicolas Bonnefon src/mainwindow.h \ 57d96f3f21SNicolas Bonnefon src/session.h \ 58d96f3f21SNicolas Bonnefon src/viewinterface.h \ 59bb02e0acSNicolas Bonnefon src/crawlerwidget.h \ 60bb02e0acSNicolas Bonnefon src/logmainview.h \ 61bb02e0acSNicolas Bonnefon src/log.h \ 62bb02e0acSNicolas Bonnefon src/filteredview.h \ 63bb02e0acSNicolas Bonnefon src/abstractlogview.h \ 64bb02e0acSNicolas Bonnefon src/optionsdialog.h \ 65bb02e0acSNicolas Bonnefon src/persistentinfo.h \ 66bb02e0acSNicolas Bonnefon src/configuration.h \ 67bb02e0acSNicolas Bonnefon src/filtersdialog.h \ 68bb02e0acSNicolas Bonnefon src/filterset.h \ 69bb02e0acSNicolas Bonnefon src/savedsearches.h \ 70bb02e0acSNicolas Bonnefon src/infoline.h \ 71bb02e0acSNicolas Bonnefon src/filewatcher.h \ 72bb02e0acSNicolas Bonnefon src/selection.h \ 73bb02e0acSNicolas Bonnefon src/quickfind.h \ 74bb02e0acSNicolas Bonnefon src/quickfindpattern.h \ 75bb02e0acSNicolas Bonnefon src/quickfindwidget.h \ 76bb02e0acSNicolas Bonnefon src/sessioninfo.h \ 77bb02e0acSNicolas Bonnefon src/persistable.h \ 78bb02e0acSNicolas Bonnefon src/recentfiles.h \ 79bb02e0acSNicolas Bonnefon src/menuactiontooltipbehavior.h \ 80bb02e0acSNicolas Bonnefon src/overview.h \ 81bb02e0acSNicolas Bonnefon src/overviewwidget.h \ 82bb02e0acSNicolas Bonnefon src/marks.h \ 83bb02e0acSNicolas Bonnefon src/qfnotifications.h \ 84*313a820fSNicolas Bonnefon src/quickfindmux.h \ 85*313a820fSNicolas Bonnefon src/signalmux.h 869a361c77SNicolas Bonnefon 872f3d4448SNicolas BonnefonisEmpty(BOOST_PATH) { 882f3d4448SNicolas Bonnefon message(Building using system dynamic Boost libraries) 894b0730ffSNicolas Bonnefon LIBS += -lboost_program_options 903e90fb01SNicolas Bonnefon} 913e90fb01SNicolas Bonnefonelse { 922f3d4448SNicolas Bonnefon message(Building using static Boost libraries at $$BOOST_PATH) 932f3d4448SNicolas Bonnefon 942f3d4448SNicolas Bonnefon SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \ 952f3d4448SNicolas Bonnefon $$BOOST_PATH/libs/smart_ptr/src/*.cpp 962f3d4448SNicolas Bonnefon 972f3d4448SNicolas Bonnefon INCLUDEPATH += $$BOOST_PATH 983e90fb01SNicolas Bonnefon} 993e90fb01SNicolas Bonnefon 100bb02e0acSNicolas BonnefonFORMS += src/optionsdialog.ui 101bb02e0acSNicolas BonnefonFORMS += src/filtersdialog.ui 1029a361c77SNicolas Bonnefon 10336b4ae36SNicolas Bonnefon# For Windows icon 10436b4ae36SNicolas BonnefonRC_FILE = glogg.rc 1059a361c77SNicolas BonnefonRESOURCES = glogg.qrc 1069a361c77SNicolas Bonnefon 107458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available) 108458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) { 109458a6a73SNicolas Bonnefon MARKDOWN += doc/documentation.markdown 110458a6a73SNicolas Bonnefon} 111458a6a73SNicolas Bonnefonelse { 112458a6a73SNicolas Bonnefon message("markdown not found, HTML doc will not be generated") 113458a6a73SNicolas Bonnefon} 114458a6a73SNicolas Bonnefon 115458a6a73SNicolas Bonnefondoc_processor.name = markdown 116458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN 117458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html 118458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \ 119458a6a73SNicolas Bonnefon sed -f finish.sed >${QMAKE_FILE_OUT} 120458a6a73SNicolas Bonnefon 121458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps 122458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files 123458a6a73SNicolas Bonnefon 124458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor 125458a6a73SNicolas Bonnefon 126b5a5d5faSNicolas Bonnefon# Install (for unix) 127fca14737SNicolas Bonnefonicon16.path = $$PREFIX/share/icons/hicolor/16x16/apps 128fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png 129fca14737SNicolas Bonnefon 130fca14737SNicolas Bonnefonicon32.path = $$PREFIX/share/icons/hicolor/32x32/apps 131fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png 132fca14737SNicolas Bonnefon 1334863be78SNicolas Bonnefonicon_svg.path = $$PREFIX/share/icons/hicolor/scalable/apps 1344863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg 1354863be78SNicolas Bonnefon 136fca14737SNicolas Bonnefondoc.path = $$PREFIX/share/doc/glogg 137458a6a73SNicolas Bonnefondoc.files += README COPYING 138fca14737SNicolas Bonnefon 139fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications 14076bf9e67SNicolas Bonnefondesktop.files = glogg.desktop 141fca14737SNicolas Bonnefon 142b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin 1434863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop 144b5a5d5faSNicolas Bonnefon 145b5a5d5faSNicolas Bonnefon# Build directories 1469a361c77SNicolas Bonnefondebug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared 1479a361c77SNicolas Bonnefonrelease:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared 1489a361c77SNicolas Bonnefondebug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared 1499a361c77SNicolas Bonnefonrelease:MOC_DIR = $${OUT_PWD}/.moc/release-shared 150821cac88SNicolas Bonnefondebug:UI_DIR = $${OUT_PWD}/.ui/debug-shared 151821cac88SNicolas Bonnefonrelease:UI_DIR = $${OUT_PWD}/.ui/release-shared 1529a361c77SNicolas Bonnefon 153f1ff9ae1SNicolas Bonnefon# Debug symbols in debug builds 154f1ff9ae1SNicolas Bonnefondebug:QMAKE_CXXFLAGS += -g 155f1ff9ae1SNicolas Bonnefon 156c51eaa77SNicolas Bonnefon# Which compiler are we using 157c51eaa77SNicolas Bonnefonsystem( g++ --version | grep -e " 4\.6" ) { 158c51eaa77SNicolas Bonnefon message ( "g++ version < 4.7, supports C++0x" ) 159c51eaa77SNicolas Bonnefon CONFIG += C++0x 160c51eaa77SNicolas Bonnefon} 161c51eaa77SNicolas Bonnefonelse { 162c51eaa77SNicolas Bonnefon system( g++ --version | grep -e " 4\.[7-9]" ) { 163c51eaa77SNicolas Bonnefon message ( "g++ version 4.7 or newer, supports C++11" ) 164c51eaa77SNicolas Bonnefon CONFIG += C++11 165c51eaa77SNicolas Bonnefon } 166c51eaa77SNicolas Bonnefon else { 167c51eaa77SNicolas Bonnefon error ( "glogg requires g++ version 4.6 or later" ) 168c51eaa77SNicolas Bonnefon } 169c51eaa77SNicolas Bonnefon} 170c51eaa77SNicolas Bonnefon 171867c74e5SNicolas Bonnefon# Extra compiler arguments 172867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++ 173e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra 174c51eaa77SNicolas BonnefonC++0x:QMAKE_CXXFLAGS += -std=c++0x 175c51eaa77SNicolas BonnefonC++11:QMAKE_CXXFLAGS += -std=c++11 176867c74e5SNicolas Bonnefon 17764c49544SNicolas BonnefonGPROF { 17864c49544SNicolas Bonnefon QMAKE_CXXFLAGS += -pg 17964c49544SNicolas Bonnefon QMAKE_LFLAGS += -pg 18064c49544SNicolas Bonnefon} 18164c49544SNicolas Bonnefon 18259d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) { 1839a361c77SNicolas Bonnefon Release:DEFINES += FILELOG_MAX_LEVEL=\"logERROR\" 184658425f1SNicolas Bonnefon Debug:DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\" 18559d49dccSNicolas Bonnefon} 18659d49dccSNicolas Bonnefonelse { 18759d49dccSNicolas Bonnefon message("Using specified log level: $$LOG_LEVEL") 18859d49dccSNicolas Bonnefon DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\" 18959d49dccSNicolas Bonnefon} 1909a361c77SNicolas Bonnefon 191b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"' 192ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) { 193afcc2cb7SNicolas Bonnefon system([ -f .tarball-version ]) { 194afcc2cb7SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\" 195afcc2cb7SNicolas Bonnefon } 196afcc2cb7SNicolas Bonnefon else { 197b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\" 198b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\" 199b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\" 200b5a5d5faSNicolas Bonnefon } 201afcc2cb7SNicolas Bonnefon} 202b5a5d5faSNicolas Bonnefonelse { 20321a1b6dcSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\" 204b5a5d5faSNicolas Bonnefon} 205458a6a73SNicolas Bonnefon 206