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 11*1e89d911SNicolas BonnefongreaterThan(QT_MAJOR_VERSION, 4): QT += core widgets 12eb6a8f99SNicolas Bonnefon 139a361c77SNicolas Bonnefonwin32:Debug:CONFIG += console 14320f9110SNicolas Bonnefon 153597d419SNicolas Bonnefon# Necessary when cross-compiling: 163597d419SNicolas Bonnefonwin32:Release:QMAKE_LFLAGS += "-Wl,-subsystem,windows" 179a361c77SNicolas Bonnefon 189a361c77SNicolas Bonnefon# Input 19bb02e0acSNicolas BonnefonSOURCES += \ 20bb02e0acSNicolas Bonnefon src/main.cpp \ 21d96f3f21SNicolas Bonnefon src/session.cpp \ 22bb02e0acSNicolas Bonnefon src/data/abstractlogdata.cpp \ 23bb02e0acSNicolas Bonnefon src/data/logdata.cpp \ 24bb02e0acSNicolas Bonnefon src/data/logfiltereddata.cpp \ 25bb02e0acSNicolas Bonnefon src/data/logfiltereddataworkerthread.cpp \ 26bb02e0acSNicolas Bonnefon src/data/logdataworkerthread.cpp \ 273c46a469SNicolas Bonnefon src/data/compressedlinestorage.cpp \ 28bb02e0acSNicolas Bonnefon src/mainwindow.cpp \ 29bb02e0acSNicolas Bonnefon src/crawlerwidget.cpp \ 30bb02e0acSNicolas Bonnefon src/abstractlogview.cpp \ 31bb02e0acSNicolas Bonnefon src/logmainview.cpp \ 32bb02e0acSNicolas Bonnefon src/filteredview.cpp \ 33bb02e0acSNicolas Bonnefon src/optionsdialog.cpp \ 34bb02e0acSNicolas Bonnefon src/persistentinfo.cpp \ 35bb02e0acSNicolas Bonnefon src/configuration.cpp \ 36bb02e0acSNicolas Bonnefon src/filtersdialog.cpp \ 37bb02e0acSNicolas Bonnefon src/filterset.cpp \ 38bb02e0acSNicolas Bonnefon src/savedsearches.cpp \ 39bb02e0acSNicolas Bonnefon src/infoline.cpp \ 40bb02e0acSNicolas Bonnefon src/menuactiontooltipbehavior.cpp \ 41bb02e0acSNicolas Bonnefon src/selection.cpp \ 42bb02e0acSNicolas Bonnefon src/quickfind.cpp \ 43bb02e0acSNicolas Bonnefon src/quickfindpattern.cpp \ 44bb02e0acSNicolas Bonnefon src/quickfindwidget.cpp \ 45bb02e0acSNicolas Bonnefon src/sessioninfo.cpp \ 46bb02e0acSNicolas Bonnefon src/recentfiles.cpp \ 47bb02e0acSNicolas Bonnefon src/overview.cpp \ 48bb02e0acSNicolas Bonnefon src/overviewwidget.cpp \ 49bb02e0acSNicolas Bonnefon src/marks.cpp \ 50313a820fSNicolas Bonnefon src/quickfindmux.cpp \ 51333b2889SNicolas Bonnefon src/signalmux.cpp \ 52557fb9d8SNicolas Bonnefon src/tabbedcrawlerwidget.cpp \ 53bb02e0acSNicolas Bonnefon 54bb02e0acSNicolas BonnefonINCLUDEPATH += src/ 559a361c77SNicolas Bonnefon 566e94dd7aSNicolas BonnefonHEADERS += \ 57bb02e0acSNicolas Bonnefon src/data/abstractlogdata.h \ 58bb02e0acSNicolas Bonnefon src/data/logdata.h \ 59bb02e0acSNicolas Bonnefon src/data/logfiltereddata.h \ 60bb02e0acSNicolas Bonnefon src/data/logfiltereddataworkerthread.h \ 61bb02e0acSNicolas Bonnefon src/data/logdataworkerthread.h \ 62bb02e0acSNicolas Bonnefon src/mainwindow.h \ 63d96f3f21SNicolas Bonnefon src/session.h \ 64d96f3f21SNicolas Bonnefon src/viewinterface.h \ 65bb02e0acSNicolas Bonnefon src/crawlerwidget.h \ 66bb02e0acSNicolas Bonnefon src/logmainview.h \ 67bb02e0acSNicolas Bonnefon src/log.h \ 68bb02e0acSNicolas Bonnefon src/filteredview.h \ 69bb02e0acSNicolas Bonnefon src/abstractlogview.h \ 70bb02e0acSNicolas Bonnefon src/optionsdialog.h \ 71bb02e0acSNicolas Bonnefon src/persistentinfo.h \ 72bb02e0acSNicolas Bonnefon src/configuration.h \ 73bb02e0acSNicolas Bonnefon src/filtersdialog.h \ 74bb02e0acSNicolas Bonnefon src/filterset.h \ 75bb02e0acSNicolas Bonnefon src/savedsearches.h \ 76bb02e0acSNicolas Bonnefon src/infoline.h \ 77bb02e0acSNicolas Bonnefon src/filewatcher.h \ 78bb02e0acSNicolas Bonnefon src/selection.h \ 79bb02e0acSNicolas Bonnefon src/quickfind.h \ 80bb02e0acSNicolas Bonnefon src/quickfindpattern.h \ 81bb02e0acSNicolas Bonnefon src/quickfindwidget.h \ 82bb02e0acSNicolas Bonnefon src/sessioninfo.h \ 83bb02e0acSNicolas Bonnefon src/persistable.h \ 84bb02e0acSNicolas Bonnefon src/recentfiles.h \ 85bb02e0acSNicolas Bonnefon src/menuactiontooltipbehavior.h \ 86bb02e0acSNicolas Bonnefon src/overview.h \ 87bb02e0acSNicolas Bonnefon src/overviewwidget.h \ 88bb02e0acSNicolas Bonnefon src/marks.h \ 89bb02e0acSNicolas Bonnefon src/qfnotifications.h \ 90313a820fSNicolas Bonnefon src/quickfindmux.h \ 91093a1bf6SNicolas Bonnefon src/signalmux.h \ 92812146a8SNicolas Bonnefon src/tabbedcrawlerwidget.h \ 93557fb9d8SNicolas Bonnefon src/loadingstatus.h \ 94557fb9d8SNicolas Bonnefon src/externalcom.h \ 959a361c77SNicolas Bonnefon 962f3d4448SNicolas BonnefonisEmpty(BOOST_PATH) { 972f3d4448SNicolas Bonnefon message(Building using system dynamic Boost libraries) 98*1e89d911SNicolas Bonnefon macx { 99*1e89d911SNicolas Bonnefon # Path for brew installed libs 100*1e89d911SNicolas Bonnefon INCLUDEPATH += /usr/local/include 101*1e89d911SNicolas Bonnefon LIBS += -L/usr/local/lib -lboost_program_options-mt 102*1e89d911SNicolas Bonnefon } 103*1e89d911SNicolas Bonnefon else { 1044b0730ffSNicolas Bonnefon LIBS += -lboost_program_options 1053e90fb01SNicolas Bonnefon } 106*1e89d911SNicolas Bonnefon} 1073e90fb01SNicolas Bonnefonelse { 1082f3d4448SNicolas Bonnefon message(Building using static Boost libraries at $$BOOST_PATH) 1092f3d4448SNicolas Bonnefon 1102f3d4448SNicolas Bonnefon SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \ 1112f3d4448SNicolas Bonnefon $$BOOST_PATH/libs/smart_ptr/src/*.cpp 1122f3d4448SNicolas Bonnefon 1132f3d4448SNicolas Bonnefon INCLUDEPATH += $$BOOST_PATH 1143e90fb01SNicolas Bonnefon} 1153e90fb01SNicolas Bonnefon 116bb02e0acSNicolas BonnefonFORMS += src/optionsdialog.ui 117bb02e0acSNicolas BonnefonFORMS += src/filtersdialog.ui 1189a361c77SNicolas Bonnefon 11936b4ae36SNicolas Bonnefon# For Windows icon 12036b4ae36SNicolas BonnefonRC_FILE = glogg.rc 1219a361c77SNicolas BonnefonRESOURCES = glogg.qrc 1229a361c77SNicolas Bonnefon 123458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available) 124458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) { 125458a6a73SNicolas Bonnefon MARKDOWN += doc/documentation.markdown 126458a6a73SNicolas Bonnefon} 127458a6a73SNicolas Bonnefonelse { 128458a6a73SNicolas Bonnefon message("markdown not found, HTML doc will not be generated") 129458a6a73SNicolas Bonnefon} 130458a6a73SNicolas Bonnefon 131458a6a73SNicolas Bonnefondoc_processor.name = markdown 132458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN 133458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html 134458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \ 135458a6a73SNicolas Bonnefon sed -f finish.sed >${QMAKE_FILE_OUT} 136458a6a73SNicolas Bonnefon 137458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps 138458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files 139458a6a73SNicolas Bonnefon 140458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor 141458a6a73SNicolas Bonnefon 142b5a5d5faSNicolas Bonnefon# Install (for unix) 143fca14737SNicolas Bonnefonicon16.path = $$PREFIX/share/icons/hicolor/16x16/apps 144fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png 145fca14737SNicolas Bonnefon 146fca14737SNicolas Bonnefonicon32.path = $$PREFIX/share/icons/hicolor/32x32/apps 147fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png 148fca14737SNicolas Bonnefon 1494863be78SNicolas Bonnefonicon_svg.path = $$PREFIX/share/icons/hicolor/scalable/apps 1504863be78SNicolas Bonnefonicon_svg.files = images/hicolor/scalable/glogg.svg 1514863be78SNicolas Bonnefon 152fca14737SNicolas Bonnefondoc.path = $$PREFIX/share/doc/glogg 153458a6a73SNicolas Bonnefondoc.files += README COPYING 154fca14737SNicolas Bonnefon 155fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications 15676bf9e67SNicolas Bonnefondesktop.files = glogg.desktop 157fca14737SNicolas Bonnefon 158b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin 1594863be78SNicolas BonnefonINSTALLS = target icon16 icon32 icon_svg doc desktop 160b5a5d5faSNicolas Bonnefon 161b5a5d5faSNicolas Bonnefon# Build directories 162ca3430bfSNicolas BonnefonCONFIG(debug, debug|release) { 163ca3430bfSNicolas Bonnefon DESTDIR = debug 164ca3430bfSNicolas Bonnefon} else { 165ca3430bfSNicolas Bonnefon DESTDIR = release 166ca3430bfSNicolas Bonnefon} 1679a361c77SNicolas Bonnefon 168ca3430bfSNicolas BonnefonOBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared 169ca3430bfSNicolas BonnefonMOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared 170ca3430bfSNicolas BonnefonUI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared 171ca3430bfSNicolas Bonnefon 172ca3430bfSNicolas Bonnefon# Debug symbols even in release build 173ca3430bfSNicolas BonnefonQMAKE_CXXFLAGS = -g 174f1ff9ae1SNicolas Bonnefon 175c51eaa77SNicolas Bonnefon# Which compiler are we using 176*1e89d911SNicolas Bonnefonsystem( $${QMAKE_CXX} --version | grep -e " 4\\.[7-9]" ) || macx { 177c51eaa77SNicolas Bonnefon message ( "g++ version 4.7 or newer, supports C++11" ) 178c51eaa77SNicolas Bonnefon CONFIG += C++11 179c51eaa77SNicolas Bonnefon} 180c51eaa77SNicolas Bonnefonelse { 181e38396b0SNicolas Bonnefon CONFIG += C++0x 182c51eaa77SNicolas Bonnefon} 183c51eaa77SNicolas Bonnefon 184867c74e5SNicolas Bonnefon# Extra compiler arguments 185867c74e5SNicolas Bonnefon# QMAKE_CXXFLAGS += -Weffc++ 186e2f31691SNicolas BonnefonQMAKE_CXXFLAGS += -Wextra 187c51eaa77SNicolas BonnefonC++0x:QMAKE_CXXFLAGS += -std=c++0x 188c51eaa77SNicolas BonnefonC++11:QMAKE_CXXFLAGS += -std=c++11 189867c74e5SNicolas Bonnefon 19064c49544SNicolas BonnefonGPROF { 19164c49544SNicolas Bonnefon QMAKE_CXXFLAGS += -pg 19264c49544SNicolas Bonnefon QMAKE_LFLAGS += -pg 19364c49544SNicolas Bonnefon} 19464c49544SNicolas Bonnefon 19559d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) { 196ca3430bfSNicolas Bonnefon CONFIG(debug, debug|release) { 197ca3430bfSNicolas Bonnefon DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\" 198ca3430bfSNicolas Bonnefon } else { 199320f9110SNicolas Bonnefon DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\" 200ca3430bfSNicolas Bonnefon } 20159d49dccSNicolas Bonnefon} 20259d49dccSNicolas Bonnefonelse { 20359d49dccSNicolas Bonnefon message("Using specified log level: $$LOG_LEVEL") 20459d49dccSNicolas Bonnefon DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\" 20559d49dccSNicolas Bonnefon} 2069a361c77SNicolas Bonnefon 207*1e89d911SNicolas Bonnefonmacx { 208*1e89d911SNicolas Bonnefon QMAKE_CXXFLAGS += -stdlib=libc++ 209*1e89d911SNicolas Bonnefon QMAKE_LFLAGS += -stdlib=libc++ 210*1e89d911SNicolas Bonnefon} 211*1e89d911SNicolas Bonnefon 212b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"' 213ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) { 214afcc2cb7SNicolas Bonnefon system([ -f .tarball-version ]) { 215afcc2cb7SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\" 216afcc2cb7SNicolas Bonnefon } 217afcc2cb7SNicolas Bonnefon else { 218b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\" 219b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\" 220b5a5d5faSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\" 221b5a5d5faSNicolas Bonnefon } 222afcc2cb7SNicolas Bonnefon} 223b5a5d5faSNicolas Bonnefonelse { 22421a1b6dcSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\" 225b5a5d5faSNicolas Bonnefon} 226458a6a73SNicolas Bonnefon 22715af0893SNicolas Bonnefon# Optional features (e.g. CONFIG+=no-dbus) 22815af0893SNicolas Bonnefonsystem(pkg-config --exists QtDBus):!no-dbus { 22915af0893SNicolas Bonnefon message("Support for D-BUS will be included") 23015af0893SNicolas Bonnefon QT += dbus 23115af0893SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_DBUS 23215af0893SNicolas Bonnefon SOURCES += src/dbusexternalcom.cpp 23315af0893SNicolas Bonnefon HEADERS += src/dbusexternalcom.h 23415af0893SNicolas Bonnefon} 23515af0893SNicolas Bonnefonelse { 23615af0893SNicolas Bonnefon message("Support for D-BUS will NOT be included") 23724895119SNicolas Bonnefon win32 { 23824895119SNicolas Bonnefon message("Support for Windows IPC will be included") 23924895119SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_WINIPC 24024895119SNicolas Bonnefon SOURCES += src/winexternalcom.cpp 24124895119SNicolas Bonnefon HEADERS += src/winexternalcom.h 24224895119SNicolas Bonnefon } 24315af0893SNicolas Bonnefon} 244431d01deSNicolas Bonnefon 245431d01deSNicolas Bonnefon# Version checking 246f109b95bSNicolas Bonnefonversion_checker { 247367bc01eSNicolas Bonnefon message("Version checker will be included") 248431d01deSNicolas Bonnefon QT += network 249431d01deSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_VERSION_CHECKING 250f109b95bSNicolas Bonnefon SOURCES += src/versionchecker.cpp 251f109b95bSNicolas Bonnefon HEADERS += src/versionchecker.h 252f109b95bSNicolas Bonnefon} 253f109b95bSNicolas Bonnefonelse { 254367bc01eSNicolas Bonnefon message("Version checker will NOT be included") 255f109b95bSNicolas Bonnefon} 2566a12446eSNicolas Bonnefon 2576a12446eSNicolas Bonnefon# File watching 25801f773eaSNicolas Bonnefonlinux-g++ || linux-g++-64 { 2596a12446eSNicolas Bonnefon CONFIG += inotify 2606a12446eSNicolas Bonnefon} 2616a12446eSNicolas Bonnefon 26280bca0a3SNicolas Bonnefonwin32 { 26380bca0a3SNicolas Bonnefon message("File watching using Windows") 26480bca0a3SNicolas Bonnefon SOURCES += src/platformfilewatcher.cpp src/winwatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp 26580bca0a3SNicolas Bonnefon HEADERS += src/platformfilewatcher.h src/winwatchtowerdriver.h src/watchtower.h src/watchtowerlist.h 26680bca0a3SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_POLLING 26780bca0a3SNicolas Bonnefon} 26880bca0a3SNicolas Bonnefonelse { 2696a12446eSNicolas Bonnefon inotify { 2706a12446eSNicolas Bonnefon message("File watching using inotify") 2716a12446eSNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_INOTIFY 272dc7f5916SNicolas Bonnefon SOURCES += src/platformfilewatcher.cpp src/inotifywatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp 273dc7f5916SNicolas Bonnefon HEADERS += src/platformfilewatcher.h src/inotifywatchtowerdriver.h src/watchtower.h src/watchtowerlist.h 27484b2179eSNicolas Bonnefon } 27584b2179eSNicolas Bonnefon else { 27601f773eaSNicolas Bonnefon message("File watching using Qt") 2776a12446eSNicolas Bonnefon SOURCES += src/qtfilewatcher.cpp 2786a12446eSNicolas Bonnefon HEADERS += src/qtfilewatcher.h 2796a12446eSNicolas Bonnefon } 28084b2179eSNicolas Bonnefon} 2818bda3285SNicolas Bonnefon 2828bda3285SNicolas Bonnefon# Performance measurement 2838bda3285SNicolas Bonnefonperf { 2848bda3285SNicolas Bonnefon QMAKE_CXXFLAGS += -DGLOGG_PERF_MEASURE_FPS 2858bda3285SNicolas Bonnefon} 286