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 \ 57ba1adacfSNicolas 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 \ 105ba1adacfSNicolas 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 13652b9eccfSAnton Filimonov RC_ICONS = glogg48.ico 137a4399322SAnton Filimonov QMAKE_TARGET_COMPANY = "Nicolas Bonnefon" 138a4399322SAnton Filimonov QMAKE_TARGET_DESCRIPTION = "glogg - the fast, smart log explorer" 139c11410ccSNicolas Bonnefon} 140c11410ccSNicolas Bonnefon 1419a361c77SNicolas BonnefonRESOURCES = glogg.qrc 1429a361c77SNicolas Bonnefon 143458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available) 144458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) { 145458a6a73SNicolas Bonnefon MARKDOWN += doc/documentation.markdown 146458a6a73SNicolas Bonnefon} 147458a6a73SNicolas Bonnefonelse { 148458a6a73SNicolas Bonnefon message("markdown not found, HTML doc will not be generated") 149458a6a73SNicolas Bonnefon} 150458a6a73SNicolas Bonnefon 151458a6a73SNicolas Bonnefondoc_processor.name = markdown 152458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN 153458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html 154458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \ 155458a6a73SNicolas Bonnefon sed -f finish.sed >${QMAKE_FILE_OUT} 156458a6a73SNicolas Bonnefon 157458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps 158458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files 159458a6a73SNicolas Bonnefon 160458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor 161458a6a73SNicolas Bonnefon 162b5a5d5faSNicolas Bonnefon# Install (for unix) 163fca14737SNicolas Bonnefonicon16.path = $$PREFIX/share/icons/hicolor/16x16/apps 164fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png 165fca14737SNicolas Bonnefon 166fca14737SNicolas Bonnefonicon32.path = $$PREFIX/share/icons/hicolor/32x32/apps 167fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png 168fca14737SNicolas Bonnefon 1694863be78SNicolas Bonnefonicon_svg.path = $$PREFIX/share/icons/hicolor/scalable/apps 1704863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg 1714863be78SNicolas Bonnefon 172fca14737SNicolas Bonnefondoc.path = $$PREFIX/share/doc/glogg 173458a6a73SNicolas Bonnefondoc.files += README COPYING 174fca14737SNicolas Bonnefon 175fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications 17676bf9e67SNicolas Bonnefondesktop.files = glogg.desktop 177fca14737SNicolas Bonnefon 178b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin 1794863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop 180b5a5d5faSNicolas Bonnefon 181b5a5d5faSNicolas Bonnefon# Build directories 182ca3430bfSNicolas BonnefonCONFIG(debug, debug|release) { 183ca3430bfSNicolas Bonnefon DESTDIR = debug 184ca3430bfSNicolas Bonnefon} else { 185ca3430bfSNicolas Bonnefon DESTDIR = release 186ca3430bfSNicolas Bonnefon} 1879a361c77SNicolas Bonnefon 188ca3430bfSNicolas BonnefonOBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared 189ca3430bfSNicolas BonnefonMOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared 190ca3430bfSNicolas BonnefonUI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared 191ca3430bfSNicolas Bonnefon 192ca3430bfSNicolas Bonnefon# Debug symbols even in release build 193ca3430bfSNicolas BonnefonQMAKE_CXXFLAGS = -g 194f1ff9ae1SNicolas Bonnefon 195*9f1607b1SAlexander HirschCONFIG += c++11 196c51eaa77SNicolas Bonnefon 197867c74e5SNicolas Bonnefon# Extra compiler arguments 198867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++ 199e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra 200867c74e5SNicolas Bonnefon 20164c49544SNicolas BonnefonGPROF { 20264c49544SNicolas Bonnefon QMAKE_CXXFLAGS += -pg 20364c49544SNicolas Bonnefon QMAKE_LFLAGS += -pg 20464c49544SNicolas Bonnefon} 20564c49544SNicolas Bonnefon 20659d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) { 207ca3430bfSNicolas Bonnefon CONFIG(debug, debug|release) { 208ca3430bfSNicolas Bonnefon DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\" 209ca3430bfSNicolas Bonnefon } else { 210320f9110SNicolas Bonnefon DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\" 211ca3430bfSNicolas Bonnefon } 21259d49dccSNicolas Bonnefon} 21359d49dccSNicolas Bonnefonelse { 21459d49dccSNicolas Bonnefon message("Using specified log level: $$LOG_LEVEL") 21559d49dccSNicolas Bonnefon DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\" 21659d49dccSNicolas Bonnefon} 2179a361c77SNicolas Bonnefon 2181e89d911SNicolas Bonnefonmacx { 2191e89d911SNicolas Bonnefon QMAKE_CXXFLAGS += -stdlib=libc++ 2201e89d911SNicolas Bonnefon QMAKE_LFLAGS += -stdlib=libc++ 221f6034637SNicolas Bonnefon 2225a87faaeSAnton Filimonov QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8 22307cff950SNicolas Bonnefon 22407cff950SNicolas Bonnefon QMAKE_INFO_PLIST = Info.plist 2251e89d911SNicolas Bonnefon} 2261e89d911SNicolas Bonnefon 227b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"' 228ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) { 229afcc2cb7SNicolas Bonnefon system([ -f .tarball-version ]) { 230afcc2cb7SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\" 231afcc2cb7SNicolas Bonnefon } 232afcc2cb7SNicolas Bonnefon else { 233b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\" 234b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\" 235b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\" 236b5a5d5faSNicolas Bonnefon } 237afcc2cb7SNicolas Bonnefon} 238b5a5d5faSNicolas Bonnefonelse { 23921a1b6dcSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\" 240b5a5d5faSNicolas Bonnefon} 241458a6a73SNicolas Bonnefon 24215af0893SNicolas Bonnefon# Optional features (e.g. CONFIG+=no-dbus) 24315af0893SNicolas Bonnefonsystem(pkg-config --exists QtDBus):!no-dbus { 24415af0893SNicolas Bonnefon message("Support for D-BUS will be included") 24515af0893SNicolas Bonnefon QT += dbus 24615af0893SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_DBUS 24715af0893SNicolas Bonnefon SOURCES += src/dbusexternalcom.cpp 24815af0893SNicolas Bonnefon HEADERS += src/dbusexternalcom.h 24915af0893SNicolas Bonnefon} 25015af0893SNicolas Bonnefonelse { 25115af0893SNicolas Bonnefon message("Support for D-BUS will NOT be included") 2520374f408SAnton Filimonov win32 || macx { 2530374f408SAnton Filimonov message("Support for cross-platform IPC will be included") 2542d1bee56SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_SOCKETIPC 2550374f408SAnton Filimonov SOURCES += src/socketexternalcom.cpp 2560374f408SAnton Filimonov HEADERS += src/socketexternalcom.h 25724895119SNicolas Bonnefon } 25815af0893SNicolas Bonnefon} 259431d01deSNicolas Bonnefon 260431d01deSNicolas Bonnefon# Version checking 261f109b95bSNicolas Bonnefonversion_checker { 262367bc01eSNicolas Bonnefon message("Version checker will be included") 263431d01deSNicolas Bonnefon QT += network 264431d01deSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_VERSION_CHECKING 265f109b95bSNicolas Bonnefon SOURCES += src/versionchecker.cpp 266f109b95bSNicolas Bonnefon HEADERS += src/versionchecker.h 267f109b95bSNicolas Bonnefon} 268f109b95bSNicolas Bonnefonelse { 269367bc01eSNicolas Bonnefon message("Version checker will NOT be included") 270f109b95bSNicolas Bonnefon} 2716a12446eSNicolas Bonnefon 2726a12446eSNicolas Bonnefon# File watching 27301f773eaSNicolas Bonnefonlinux-g++ || linux-g++-64 { 2746a12446eSNicolas Bonnefon CONFIG += inotify 2756a12446eSNicolas Bonnefon} 2766a12446eSNicolas Bonnefon 277f869e41dSNicolas Bonnefonmacx { 278f869e41dSNicolas Bonnefon CONFIG += kqueue 279f869e41dSNicolas Bonnefon} 280f869e41dSNicolas Bonnefon 28180bca0a3SNicolas Bonnefonwin32 { 28280bca0a3SNicolas Bonnefon message("File watching using Windows") 28380bca0a3SNicolas Bonnefon SOURCES += src/platformfilewatcher.cpp src/winwatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp 28480bca0a3SNicolas Bonnefon HEADERS += src/platformfilewatcher.h src/winwatchtowerdriver.h src/watchtower.h src/watchtowerlist.h 28580bca0a3SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_POLLING 28680bca0a3SNicolas Bonnefon} 28780bca0a3SNicolas Bonnefonelse { 2886a12446eSNicolas Bonnefon inotify { 2896a12446eSNicolas Bonnefon message("File watching using inotify") 2906a12446eSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_INOTIFY 291dc7f5916SNicolas Bonnefon SOURCES += src/platformfilewatcher.cpp src/inotifywatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp 292dc7f5916SNicolas Bonnefon HEADERS += src/platformfilewatcher.h src/inotifywatchtowerdriver.h src/watchtower.h src/watchtowerlist.h 29384b2179eSNicolas Bonnefon } 29484b2179eSNicolas Bonnefon else { 295f869e41dSNicolas Bonnefon macx { 296f869e41dSNicolas Bonnefon message("File watching using kqueue") 297f869e41dSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_KQUEUE 298f869e41dSNicolas Bonnefon SOURCES += src/platformfilewatcher.cpp src/kqueuewatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp 299f869e41dSNicolas Bonnefon HEADERS += src/platformfilewatcher.h src/kqueuewatchtowerdriver.h src/watchtower.h src/watchtowerlist.h 300f869e41dSNicolas Bonnefon } 301f869e41dSNicolas Bonnefon else { 30201f773eaSNicolas Bonnefon message("File watching using Qt") 3036a12446eSNicolas Bonnefon SOURCES += src/qtfilewatcher.cpp 3046a12446eSNicolas Bonnefon HEADERS += src/qtfilewatcher.h 3056a12446eSNicolas Bonnefon } 30684b2179eSNicolas Bonnefon } 307f869e41dSNicolas Bonnefon} 3088bda3285SNicolas Bonnefon 3098bda3285SNicolas Bonnefon# Performance measurement 3108bda3285SNicolas Bonnefonperf { 3118bda3285SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_PERF_MEASURE_FPS 3128bda3285SNicolas Bonnefon} 313