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 \ 16*d96f3f21SNicolas 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 \ 45bb02e0acSNicolas Bonnefon src/quickfindmux.cpp 46bb02e0acSNicolas Bonnefon 47bb02e0acSNicolas BonnefonINCLUDEPATH += src/ 489a361c77SNicolas Bonnefon 496e94dd7aSNicolas BonnefonHEADERS += \ 50bb02e0acSNicolas Bonnefon src/data/abstractlogdata.h \ 51bb02e0acSNicolas Bonnefon src/data/logdata.h \ 52bb02e0acSNicolas Bonnefon src/data/logfiltereddata.h \ 53bb02e0acSNicolas Bonnefon src/data/logfiltereddataworkerthread.h \ 54bb02e0acSNicolas Bonnefon src/data/logdataworkerthread.h \ 55bb02e0acSNicolas Bonnefon src/mainwindow.h \ 56*d96f3f21SNicolas Bonnefon src/session.h \ 57*d96f3f21SNicolas Bonnefon src/viewinterface.h \ 58bb02e0acSNicolas Bonnefon src/crawlerwidget.h \ 59bb02e0acSNicolas Bonnefon src/logmainview.h \ 60bb02e0acSNicolas Bonnefon src/log.h \ 61bb02e0acSNicolas Bonnefon src/filteredview.h \ 62bb02e0acSNicolas Bonnefon src/abstractlogview.h \ 63bb02e0acSNicolas Bonnefon src/optionsdialog.h \ 64bb02e0acSNicolas Bonnefon src/persistentinfo.h \ 65bb02e0acSNicolas Bonnefon src/configuration.h \ 66bb02e0acSNicolas Bonnefon src/filtersdialog.h \ 67bb02e0acSNicolas Bonnefon src/filterset.h \ 68bb02e0acSNicolas Bonnefon src/savedsearches.h \ 69bb02e0acSNicolas Bonnefon src/infoline.h \ 70bb02e0acSNicolas Bonnefon src/filewatcher.h \ 71bb02e0acSNicolas Bonnefon src/selection.h \ 72bb02e0acSNicolas Bonnefon src/quickfind.h \ 73bb02e0acSNicolas Bonnefon src/quickfindpattern.h \ 74bb02e0acSNicolas Bonnefon src/quickfindwidget.h \ 75bb02e0acSNicolas Bonnefon src/sessioninfo.h \ 76bb02e0acSNicolas Bonnefon src/persistable.h \ 77bb02e0acSNicolas Bonnefon src/recentfiles.h \ 78bb02e0acSNicolas Bonnefon src/menuactiontooltipbehavior.h \ 79bb02e0acSNicolas Bonnefon src/overview.h \ 80bb02e0acSNicolas Bonnefon src/overviewwidget.h \ 81bb02e0acSNicolas Bonnefon src/marks.h \ 82bb02e0acSNicolas Bonnefon src/qfnotifications.h \ 83bb02e0acSNicolas Bonnefon src/quickfindmux.h 849a361c77SNicolas Bonnefon 852f3d4448SNicolas BonnefonisEmpty(BOOST_PATH) { 862f3d4448SNicolas Bonnefon message(Building using system dynamic Boost libraries) 874b0730ffSNicolas Bonnefon LIBS += -lboost_program_options 883e90fb01SNicolas Bonnefon} 893e90fb01SNicolas Bonnefonelse { 902f3d4448SNicolas Bonnefon message(Building using static Boost libraries at $$BOOST_PATH) 912f3d4448SNicolas Bonnefon 922f3d4448SNicolas Bonnefon SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \ 932f3d4448SNicolas Bonnefon $$BOOST_PATH/libs/smart_ptr/src/*.cpp 942f3d4448SNicolas Bonnefon 952f3d4448SNicolas Bonnefon INCLUDEPATH += $$BOOST_PATH 963e90fb01SNicolas Bonnefon} 973e90fb01SNicolas Bonnefon 98bb02e0acSNicolas BonnefonFORMS += src/optionsdialog.ui 99bb02e0acSNicolas BonnefonFORMS += src/filtersdialog.ui 1009a361c77SNicolas Bonnefon 10136b4ae36SNicolas Bonnefon# For Windows icon 10236b4ae36SNicolas BonnefonRC_FILE = glogg.rc 1039a361c77SNicolas BonnefonRESOURCES = glogg.qrc 1049a361c77SNicolas Bonnefon 105458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available) 106458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) { 107458a6a73SNicolas Bonnefon MARKDOWN += doc/documentation.markdown 108458a6a73SNicolas Bonnefon} 109458a6a73SNicolas Bonnefonelse { 110458a6a73SNicolas Bonnefon message("markdown not found, HTML doc will not be generated") 111458a6a73SNicolas Bonnefon} 112458a6a73SNicolas Bonnefon 113458a6a73SNicolas Bonnefondoc_processor.name = markdown 114458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN 115458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html 116458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \ 117458a6a73SNicolas Bonnefon sed -f finish.sed >${QMAKE_FILE_OUT} 118458a6a73SNicolas Bonnefon 119458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps 120458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files 121458a6a73SNicolas Bonnefon 122458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor 123458a6a73SNicolas Bonnefon 124b5a5d5faSNicolas Bonnefon# Install (for unix) 125fca14737SNicolas Bonnefonicon16.path = $$PREFIX/share/icons/hicolor/16x16/apps 126fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png 127fca14737SNicolas Bonnefon 128fca14737SNicolas Bonnefonicon32.path = $$PREFIX/share/icons/hicolor/32x32/apps 129fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png 130fca14737SNicolas Bonnefon 1314863be78SNicolas Bonnefonicon_svg.path = $$PREFIX/share/icons/hicolor/scalable/apps 1324863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg 1334863be78SNicolas Bonnefon 134fca14737SNicolas Bonnefondoc.path = $$PREFIX/share/doc/glogg 135458a6a73SNicolas Bonnefondoc.files += README COPYING 136fca14737SNicolas Bonnefon 137fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications 13876bf9e67SNicolas Bonnefondesktop.files = glogg.desktop 139fca14737SNicolas Bonnefon 140b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin 1414863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop 142b5a5d5faSNicolas Bonnefon 143b5a5d5faSNicolas Bonnefon# Build directories 1449a361c77SNicolas Bonnefondebug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared 1459a361c77SNicolas Bonnefonrelease:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared 1469a361c77SNicolas Bonnefondebug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared 1479a361c77SNicolas Bonnefonrelease:MOC_DIR = $${OUT_PWD}/.moc/release-shared 148821cac88SNicolas Bonnefondebug:UI_DIR = $${OUT_PWD}/.ui/debug-shared 149821cac88SNicolas Bonnefonrelease:UI_DIR = $${OUT_PWD}/.ui/release-shared 1509a361c77SNicolas Bonnefon 151f1ff9ae1SNicolas Bonnefon# Debug symbols in debug builds 152f1ff9ae1SNicolas Bonnefondebug:QMAKE_CXXFLAGS += -g 153f1ff9ae1SNicolas Bonnefon 154c51eaa77SNicolas Bonnefon# Which compiler are we using 155c51eaa77SNicolas Bonnefonsystem( g++ --version | grep -e " 4\.6" ) { 156c51eaa77SNicolas Bonnefon message ( "g++ version < 4.7, supports C++0x" ) 157c51eaa77SNicolas Bonnefon CONFIG += C++0x 158c51eaa77SNicolas Bonnefon} 159c51eaa77SNicolas Bonnefonelse { 160c51eaa77SNicolas Bonnefon system( g++ --version | grep -e " 4\.[7-9]" ) { 161c51eaa77SNicolas Bonnefon message ( "g++ version 4.7 or newer, supports C++11" ) 162c51eaa77SNicolas Bonnefon CONFIG += C++11 163c51eaa77SNicolas Bonnefon } 164c51eaa77SNicolas Bonnefon else { 165c51eaa77SNicolas Bonnefon error ( "glogg requires g++ version 4.6 or later" ) 166c51eaa77SNicolas Bonnefon } 167c51eaa77SNicolas Bonnefon} 168c51eaa77SNicolas Bonnefon 169867c74e5SNicolas Bonnefon# Extra compiler arguments 170867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++ 171e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra 172c51eaa77SNicolas BonnefonC++0x:QMAKE_CXXFLAGS += -std=c++0x 173c51eaa77SNicolas BonnefonC++11:QMAKE_CXXFLAGS += -std=c++11 174867c74e5SNicolas Bonnefon 17564c49544SNicolas BonnefonGPROF { 17664c49544SNicolas Bonnefon QMAKE_CXXFLAGS += -pg 17764c49544SNicolas Bonnefon QMAKE_LFLAGS += -pg 17864c49544SNicolas Bonnefon} 17964c49544SNicolas Bonnefon 18059d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) { 1819a361c77SNicolas Bonnefon Release:DEFINES += FILELOG_MAX_LEVEL=\"logERROR\" 182658425f1SNicolas Bonnefon Debug:DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\" 18359d49dccSNicolas Bonnefon} 18459d49dccSNicolas Bonnefonelse { 18559d49dccSNicolas Bonnefon message("Using specified log level: $$LOG_LEVEL") 18659d49dccSNicolas Bonnefon DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\" 18759d49dccSNicolas Bonnefon} 1889a361c77SNicolas Bonnefon 189b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"' 190ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) { 191afcc2cb7SNicolas Bonnefon system([ -f .tarball-version ]) { 192afcc2cb7SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\" 193afcc2cb7SNicolas Bonnefon } 194afcc2cb7SNicolas Bonnefon else { 195b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\" 196b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\" 197b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\" 198b5a5d5faSNicolas Bonnefon } 199afcc2cb7SNicolas Bonnefon} 200b5a5d5faSNicolas Bonnefonelse { 20121a1b6dcSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\" 202b5a5d5faSNicolas Bonnefon} 203458a6a73SNicolas Bonnefon 204