19a361c77SNicolas Bonnefon# ------------------------------------------------- 29a361c77SNicolas Bonnefon# glogg 39a361c77SNicolas Bonnefon# ------------------------------------------------- 4ca3430bfSNicolas Bonnefon 5ca3430bfSNicolas Bonnefon# Debug builds: qmake CONFIG+=debug 6ca3430bfSNicolas Bonnefon# Release builds: qmake 7ca3430bfSNicolas Bonnefon 89a361c77SNicolas BonnefonTARGET = glogg 99a361c77SNicolas BonnefonTEMPLATE = app 109a361c77SNicolas Bonnefon 110374f408SAnton FilimonovQT += network 120374f408SAnton Filimonov 131e89d911SNicolas BonnefongreaterThan(QT_MAJOR_VERSION, 4): QT += core widgets 14eb6a8f99SNicolas Bonnefon 159a361c77SNicolas Bonnefonwin32:Debug:CONFIG += console 16320f9110SNicolas Bonnefon 173597d419SNicolas Bonnefon# Necessary when cross-compiling: 183597d419SNicolas Bonnefonwin32:Release:QMAKE_LFLAGS += "-Wl,-subsystem,windows" 199a361c77SNicolas Bonnefon 209a361c77SNicolas Bonnefon# Input 21bb02e0acSNicolas BonnefonSOURCES += \ 22bb02e0acSNicolas Bonnefon src/main.cpp \ 23d96f3f21SNicolas Bonnefon src/session.cpp \ 24bb02e0acSNicolas Bonnefon src/data/abstractlogdata.cpp \ 25bb02e0acSNicolas Bonnefon src/data/logdata.cpp \ 26bb02e0acSNicolas Bonnefon src/data/logfiltereddata.cpp \ 27bb02e0acSNicolas Bonnefon src/data/logfiltereddataworkerthread.cpp \ 28bb02e0acSNicolas Bonnefon src/data/logdataworkerthread.cpp \ 293c46a469SNicolas Bonnefon src/data/compressedlinestorage.cpp \ 30bb02e0acSNicolas Bonnefon src/mainwindow.cpp \ 31bb02e0acSNicolas Bonnefon src/crawlerwidget.cpp \ 32bb02e0acSNicolas Bonnefon src/abstractlogview.cpp \ 33bb02e0acSNicolas Bonnefon src/logmainview.cpp \ 34bb02e0acSNicolas Bonnefon src/filteredview.cpp \ 35bb02e0acSNicolas Bonnefon src/optionsdialog.cpp \ 36bb02e0acSNicolas Bonnefon src/persistentinfo.cpp \ 37bb02e0acSNicolas Bonnefon src/configuration.cpp \ 38bb02e0acSNicolas Bonnefon src/filtersdialog.cpp \ 39bb02e0acSNicolas Bonnefon src/filterset.cpp \ 40bb02e0acSNicolas Bonnefon src/savedsearches.cpp \ 41bb02e0acSNicolas Bonnefon src/infoline.cpp \ 42bb02e0acSNicolas Bonnefon src/menuactiontooltipbehavior.cpp \ 43bb02e0acSNicolas Bonnefon src/selection.cpp \ 44bb02e0acSNicolas Bonnefon src/quickfind.cpp \ 45bb02e0acSNicolas Bonnefon src/quickfindpattern.cpp \ 46bb02e0acSNicolas Bonnefon src/quickfindwidget.cpp \ 47bb02e0acSNicolas Bonnefon src/sessioninfo.cpp \ 48bb02e0acSNicolas Bonnefon src/recentfiles.cpp \ 49bb02e0acSNicolas Bonnefon src/overview.cpp \ 50bb02e0acSNicolas Bonnefon src/overviewwidget.cpp \ 51bb02e0acSNicolas Bonnefon src/marks.cpp \ 52313a820fSNicolas Bonnefon src/quickfindmux.cpp \ 53333b2889SNicolas Bonnefon src/signalmux.cpp \ 54557fb9d8SNicolas Bonnefon src/tabbedcrawlerwidget.cpp \ 550b05c6eaSNicolas Bonnefon src/viewtools.cpp \ 565fa25391SNicolas Bonnefon src/encodingspeculator.cpp \ 57*ba1adacfSNicolas Bonnefon src/gloggapp.cpp \ 58bb02e0acSNicolas Bonnefon 59bb02e0acSNicolas BonnefonINCLUDEPATH += src/ 609a361c77SNicolas Bonnefon 616e94dd7aSNicolas BonnefonHEADERS += \ 62bb02e0acSNicolas Bonnefon src/data/abstractlogdata.h \ 63bb02e0acSNicolas Bonnefon src/data/logdata.h \ 64bb02e0acSNicolas Bonnefon src/data/logfiltereddata.h \ 65bb02e0acSNicolas Bonnefon src/data/logfiltereddataworkerthread.h \ 66bb02e0acSNicolas Bonnefon src/data/logdataworkerthread.h \ 670374f408SAnton Filimonov src/data/threadprivatestore.h \ 680374f408SAnton Filimonov src/data/compressedlinestorage.h \ 690374f408SAnton Filimonov src/data/linepositionarray.h \ 70bb02e0acSNicolas Bonnefon src/mainwindow.h \ 71d96f3f21SNicolas Bonnefon src/session.h \ 72d96f3f21SNicolas Bonnefon src/viewinterface.h \ 73bb02e0acSNicolas Bonnefon src/crawlerwidget.h \ 74bb02e0acSNicolas Bonnefon src/logmainview.h \ 75bb02e0acSNicolas Bonnefon src/log.h \ 76bb02e0acSNicolas Bonnefon src/filteredview.h \ 77bb02e0acSNicolas Bonnefon src/abstractlogview.h \ 78bb02e0acSNicolas Bonnefon src/optionsdialog.h \ 79bb02e0acSNicolas Bonnefon src/persistentinfo.h \ 80bb02e0acSNicolas Bonnefon src/configuration.h \ 81bb02e0acSNicolas Bonnefon src/filtersdialog.h \ 82bb02e0acSNicolas Bonnefon src/filterset.h \ 83bb02e0acSNicolas Bonnefon src/savedsearches.h \ 84bb02e0acSNicolas Bonnefon src/infoline.h \ 85bb02e0acSNicolas Bonnefon src/filewatcher.h \ 86bb02e0acSNicolas Bonnefon src/selection.h \ 87bb02e0acSNicolas Bonnefon src/quickfind.h \ 88bb02e0acSNicolas Bonnefon src/quickfindpattern.h \ 89bb02e0acSNicolas Bonnefon src/quickfindwidget.h \ 90bb02e0acSNicolas Bonnefon src/sessioninfo.h \ 91bb02e0acSNicolas Bonnefon src/persistable.h \ 92bb02e0acSNicolas Bonnefon src/recentfiles.h \ 93bb02e0acSNicolas Bonnefon src/menuactiontooltipbehavior.h \ 94bb02e0acSNicolas Bonnefon src/overview.h \ 95bb02e0acSNicolas Bonnefon src/overviewwidget.h \ 96bb02e0acSNicolas Bonnefon src/marks.h \ 97bb02e0acSNicolas Bonnefon src/qfnotifications.h \ 98313a820fSNicolas Bonnefon src/quickfindmux.h \ 99093a1bf6SNicolas Bonnefon src/signalmux.h \ 100812146a8SNicolas Bonnefon src/tabbedcrawlerwidget.h \ 101557fb9d8SNicolas Bonnefon src/loadingstatus.h \ 102557fb9d8SNicolas Bonnefon src/externalcom.h \ 1030b05c6eaSNicolas Bonnefon src/viewtools.h \ 1045fa25391SNicolas Bonnefon src/encodingspeculator.h \ 105*ba1adacfSNicolas Bonnefon src/gloggapp.h \ 1069a361c77SNicolas Bonnefon 1072f3d4448SNicolas BonnefonisEmpty(BOOST_PATH) { 1082f3d4448SNicolas Bonnefon message(Building using system dynamic Boost libraries) 1091e89d911SNicolas Bonnefon macx { 1101e89d911SNicolas Bonnefon # Path for brew installed libs 1111e89d911SNicolas Bonnefon INCLUDEPATH += /usr/local/include 1121e89d911SNicolas Bonnefon LIBS += -L/usr/local/lib -lboost_program_options-mt 1131e89d911SNicolas Bonnefon } 1141e89d911SNicolas Bonnefon else { 1154b0730ffSNicolas Bonnefon LIBS += -lboost_program_options 1163e90fb01SNicolas Bonnefon } 1171e89d911SNicolas Bonnefon} 1183e90fb01SNicolas Bonnefonelse { 1192f3d4448SNicolas Bonnefon message(Building using static Boost libraries at $$BOOST_PATH) 1202f3d4448SNicolas Bonnefon 1212f3d4448SNicolas Bonnefon SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \ 1222f3d4448SNicolas Bonnefon $$BOOST_PATH/libs/smart_ptr/src/*.cpp 1232f3d4448SNicolas Bonnefon 1242f3d4448SNicolas Bonnefon INCLUDEPATH += $$BOOST_PATH 1253e90fb01SNicolas Bonnefon} 1263e90fb01SNicolas Bonnefon 127bb02e0acSNicolas BonnefonFORMS += src/optionsdialog.ui 128bb02e0acSNicolas BonnefonFORMS += src/filtersdialog.ui 1299a361c77SNicolas Bonnefon 130c11410ccSNicolas Bonnefonmacx { 131c11410ccSNicolas Bonnefon # Icon for Mac 132c11410ccSNicolas Bonnefon ICON = images/glogg.icns 133c11410ccSNicolas Bonnefon} 134c11410ccSNicolas Bonnefonelse { 13536b4ae36SNicolas Bonnefon # For Windows icon 13636b4ae36SNicolas Bonnefon RC_FILE = glogg.rc 137c11410ccSNicolas Bonnefon} 138c11410ccSNicolas Bonnefon 1399a361c77SNicolas BonnefonRESOURCES = glogg.qrc 1409a361c77SNicolas Bonnefon 141458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available) 142458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) { 143458a6a73SNicolas Bonnefon MARKDOWN += doc/documentation.markdown 144458a6a73SNicolas Bonnefon} 145458a6a73SNicolas Bonnefonelse { 146458a6a73SNicolas Bonnefon message("markdown not found, HTML doc will not be generated") 147458a6a73SNicolas Bonnefon} 148458a6a73SNicolas Bonnefon 149458a6a73SNicolas Bonnefondoc_processor.name = markdown 150458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN 151458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html 152458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \ 153458a6a73SNicolas Bonnefon sed -f finish.sed >${QMAKE_FILE_OUT} 154458a6a73SNicolas Bonnefon 155458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps 156458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files 157458a6a73SNicolas Bonnefon 158458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor 159458a6a73SNicolas Bonnefon 160b5a5d5faSNicolas Bonnefon# Install (for unix) 161fca14737SNicolas Bonnefonicon16.path = $$PREFIX/share/icons/hicolor/16x16/apps 162fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png 163fca14737SNicolas Bonnefon 164fca14737SNicolas Bonnefonicon32.path = $$PREFIX/share/icons/hicolor/32x32/apps 165fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png 166fca14737SNicolas Bonnefon 1674863be78SNicolas Bonnefonicon_svg.path = $$PREFIX/share/icons/hicolor/scalable/apps 1684863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg 1694863be78SNicolas Bonnefon 170fca14737SNicolas Bonnefondoc.path = $$PREFIX/share/doc/glogg 171458a6a73SNicolas Bonnefondoc.files += README COPYING 172fca14737SNicolas Bonnefon 173fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications 17476bf9e67SNicolas Bonnefondesktop.files = glogg.desktop 175fca14737SNicolas Bonnefon 176b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin 1774863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop 178b5a5d5faSNicolas Bonnefon 179b5a5d5faSNicolas Bonnefon# Build directories 180ca3430bfSNicolas BonnefonCONFIG(debug, debug|release) { 181ca3430bfSNicolas Bonnefon DESTDIR = debug 182ca3430bfSNicolas Bonnefon} else { 183ca3430bfSNicolas Bonnefon DESTDIR = release 184ca3430bfSNicolas Bonnefon} 1859a361c77SNicolas Bonnefon 186ca3430bfSNicolas BonnefonOBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared 187ca3430bfSNicolas BonnefonMOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared 188ca3430bfSNicolas BonnefonUI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared 189ca3430bfSNicolas Bonnefon 190ca3430bfSNicolas Bonnefon# Debug symbols even in release build 191ca3430bfSNicolas BonnefonQMAKE_CXXFLAGS = -g 192f1ff9ae1SNicolas Bonnefon 193c51eaa77SNicolas Bonnefon# Which compiler are we using 1941e89d911SNicolas Bonnefonsystem( $${QMAKE_CXX} --version | grep -e " 4\\.[7-9]" ) || macx { 195c51eaa77SNicolas Bonnefon message ( "g++ version 4.7 or newer, supports C++11" ) 196c51eaa77SNicolas Bonnefon CONFIG += C++11 197c51eaa77SNicolas Bonnefon} 198c51eaa77SNicolas Bonnefonelse { 199e38396b0SNicolas Bonnefon CONFIG += C++0x 200c51eaa77SNicolas Bonnefon} 201c51eaa77SNicolas Bonnefon 202867c74e5SNicolas Bonnefon# Extra compiler arguments 203867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++ 204e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra 205c51eaa77SNicolas BonnefonC++0x:QMAKE_CXXFLAGS += -std=c++0x 206c51eaa77SNicolas BonnefonC++11:QMAKE_CXXFLAGS += -std=c++11 207867c74e5SNicolas Bonnefon 20864c49544SNicolas BonnefonGPROF { 20964c49544SNicolas Bonnefon QMAKE_CXXFLAGS += -pg 21064c49544SNicolas Bonnefon QMAKE_LFLAGS += -pg 21164c49544SNicolas Bonnefon} 21264c49544SNicolas Bonnefon 21359d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) { 214ca3430bfSNicolas Bonnefon CONFIG(debug, debug|release) { 215ca3430bfSNicolas Bonnefon DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\" 216ca3430bfSNicolas Bonnefon } else { 217320f9110SNicolas Bonnefon DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\" 218ca3430bfSNicolas Bonnefon } 21959d49dccSNicolas Bonnefon} 22059d49dccSNicolas Bonnefonelse { 22159d49dccSNicolas Bonnefon message("Using specified log level: $$LOG_LEVEL") 22259d49dccSNicolas Bonnefon DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\" 22359d49dccSNicolas Bonnefon} 2249a361c77SNicolas Bonnefon 2251e89d911SNicolas Bonnefonmacx { 2261e89d911SNicolas Bonnefon QMAKE_CXXFLAGS += -stdlib=libc++ 2271e89d911SNicolas Bonnefon QMAKE_LFLAGS += -stdlib=libc++ 228f6034637SNicolas Bonnefon 2298b941e12SAnton Filimonov QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 2301e89d911SNicolas Bonnefon} 2311e89d911SNicolas Bonnefon 232b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"' 233ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) { 234afcc2cb7SNicolas Bonnefon system([ -f .tarball-version ]) { 235afcc2cb7SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\" 236afcc2cb7SNicolas Bonnefon } 237afcc2cb7SNicolas Bonnefon else { 238b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\" 239b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\" 240b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\" 241b5a5d5faSNicolas Bonnefon } 242afcc2cb7SNicolas Bonnefon} 243b5a5d5faSNicolas Bonnefonelse { 24421a1b6dcSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\" 245b5a5d5faSNicolas Bonnefon} 246458a6a73SNicolas Bonnefon 24715af0893SNicolas Bonnefon# Optional features (e.g. CONFIG+=no-dbus) 24815af0893SNicolas Bonnefonsystem(pkg-config --exists QtDBus):!no-dbus { 24915af0893SNicolas Bonnefon message("Support for D-BUS will be included") 25015af0893SNicolas Bonnefon QT += dbus 25115af0893SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_DBUS 25215af0893SNicolas Bonnefon SOURCES += src/dbusexternalcom.cpp 25315af0893SNicolas Bonnefon HEADERS += src/dbusexternalcom.h 25415af0893SNicolas Bonnefon} 25515af0893SNicolas Bonnefonelse { 25615af0893SNicolas Bonnefon message("Support for D-BUS will NOT be included") 2570374f408SAnton Filimonov win32 || macx { 2580374f408SAnton Filimonov message("Support for cross-platform IPC will be included") 2592d1bee56SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_SOCKETIPC 2600374f408SAnton Filimonov SOURCES += src/socketexternalcom.cpp 2610374f408SAnton Filimonov HEADERS += src/socketexternalcom.h 26224895119SNicolas Bonnefon } 26315af0893SNicolas Bonnefon} 264431d01deSNicolas Bonnefon 265431d01deSNicolas Bonnefon# Version checking 266f109b95bSNicolas Bonnefonversion_checker { 267367bc01eSNicolas Bonnefon message("Version checker will be included") 268431d01deSNicolas Bonnefon QT += network 269431d01deSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_VERSION_CHECKING 270f109b95bSNicolas Bonnefon SOURCES += src/versionchecker.cpp 271f109b95bSNicolas Bonnefon HEADERS += src/versionchecker.h 272f109b95bSNicolas Bonnefon} 273f109b95bSNicolas Bonnefonelse { 274367bc01eSNicolas Bonnefon message("Version checker will NOT be included") 275f109b95bSNicolas Bonnefon} 2766a12446eSNicolas Bonnefon 2776a12446eSNicolas Bonnefon# File watching 27801f773eaSNicolas Bonnefonlinux-g++ || linux-g++-64 { 2796a12446eSNicolas Bonnefon CONFIG += inotify 2806a12446eSNicolas Bonnefon} 2816a12446eSNicolas Bonnefon 28280bca0a3SNicolas Bonnefonwin32 { 28380bca0a3SNicolas Bonnefon message("File watching using Windows") 28480bca0a3SNicolas Bonnefon SOURCES += src/platformfilewatcher.cpp src/winwatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp 28580bca0a3SNicolas Bonnefon HEADERS += src/platformfilewatcher.h src/winwatchtowerdriver.h src/watchtower.h src/watchtowerlist.h 28680bca0a3SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_POLLING 28780bca0a3SNicolas Bonnefon} 28880bca0a3SNicolas Bonnefonelse { 2896a12446eSNicolas Bonnefon inotify { 2906a12446eSNicolas Bonnefon message("File watching using inotify") 2916a12446eSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_INOTIFY 292dc7f5916SNicolas Bonnefon SOURCES += src/platformfilewatcher.cpp src/inotifywatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp 293dc7f5916SNicolas Bonnefon HEADERS += src/platformfilewatcher.h src/inotifywatchtowerdriver.h src/watchtower.h src/watchtowerlist.h 29484b2179eSNicolas Bonnefon } 29584b2179eSNicolas Bonnefon else { 29601f773eaSNicolas Bonnefon message("File watching using Qt") 2976a12446eSNicolas Bonnefon SOURCES += src/qtfilewatcher.cpp 2986a12446eSNicolas Bonnefon HEADERS += src/qtfilewatcher.h 2996a12446eSNicolas Bonnefon } 30084b2179eSNicolas Bonnefon} 3018bda3285SNicolas Bonnefon 3028bda3285SNicolas Bonnefon# Performance measurement 3038bda3285SNicolas Bonnefonperf { 3048bda3285SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_PERF_MEASURE_FPS 3058bda3285SNicolas Bonnefon} 306