1# ------------------------------------------------- 2# glogg 3# ------------------------------------------------- 4 5# Debug builds: qmake CONFIG+=debug 6# Release builds: qmake 7 8TARGET = glogg 9TEMPLATE = app 10 11QT += network 12 13greaterThan(QT_MAJOR_VERSION, 4): QT += core widgets 14 15win32:Debug:CONFIG += console 16 17# Necessary when cross-compiling: 18win32:Release:QMAKE_LFLAGS += "-Wl,-subsystem,windows" 19 20# Input 21SOURCES += \ 22 src/main.cpp \ 23 src/session.cpp \ 24 src/data/abstractlogdata.cpp \ 25 src/data/logdata.cpp \ 26 src/data/logfiltereddata.cpp \ 27 src/data/logfiltereddataworkerthread.cpp \ 28 src/data/logdataworkerthread.cpp \ 29 src/data/compressedlinestorage.cpp \ 30 src/mainwindow.cpp \ 31 src/crawlerwidget.cpp \ 32 src/abstractlogview.cpp \ 33 src/logmainview.cpp \ 34 src/filteredview.cpp \ 35 src/optionsdialog.cpp \ 36 src/persistentinfo.cpp \ 37 src/configuration.cpp \ 38 src/filtersdialog.cpp \ 39 src/filterset.cpp \ 40 src/savedsearches.cpp \ 41 src/infoline.cpp \ 42 src/menuactiontooltipbehavior.cpp \ 43 src/selection.cpp \ 44 src/quickfind.cpp \ 45 src/quickfindpattern.cpp \ 46 src/quickfindwidget.cpp \ 47 src/sessioninfo.cpp \ 48 src/recentfiles.cpp \ 49 src/overview.cpp \ 50 src/overviewwidget.cpp \ 51 src/marks.cpp \ 52 src/quickfindmux.cpp \ 53 src/signalmux.cpp \ 54 src/tabbedcrawlerwidget.cpp \ 55 src/viewtools.cpp \ 56 src/encodingspeculator.cpp \ 57 src/gloggapp.cpp \ 58 59INCLUDEPATH += src/ 60 61HEADERS += \ 62 src/data/abstractlogdata.h \ 63 src/data/logdata.h \ 64 src/data/logfiltereddata.h \ 65 src/data/logfiltereddataworkerthread.h \ 66 src/data/logdataworkerthread.h \ 67 src/data/threadprivatestore.h \ 68 src/data/compressedlinestorage.h \ 69 src/data/linepositionarray.h \ 70 src/mainwindow.h \ 71 src/session.h \ 72 src/viewinterface.h \ 73 src/crawlerwidget.h \ 74 src/logmainview.h \ 75 src/log.h \ 76 src/filteredview.h \ 77 src/abstractlogview.h \ 78 src/optionsdialog.h \ 79 src/persistentinfo.h \ 80 src/configuration.h \ 81 src/filtersdialog.h \ 82 src/filterset.h \ 83 src/savedsearches.h \ 84 src/infoline.h \ 85 src/filewatcher.h \ 86 src/selection.h \ 87 src/quickfind.h \ 88 src/quickfindpattern.h \ 89 src/quickfindwidget.h \ 90 src/sessioninfo.h \ 91 src/persistable.h \ 92 src/recentfiles.h \ 93 src/menuactiontooltipbehavior.h \ 94 src/overview.h \ 95 src/overviewwidget.h \ 96 src/marks.h \ 97 src/qfnotifications.h \ 98 src/quickfindmux.h \ 99 src/signalmux.h \ 100 src/tabbedcrawlerwidget.h \ 101 src/loadingstatus.h \ 102 src/externalcom.h \ 103 src/viewtools.h \ 104 src/encodingspeculator.h \ 105 src/gloggapp.h \ 106 107isEmpty(BOOST_PATH) { 108 message(Building using system dynamic Boost libraries) 109 macx { 110 # Path for brew installed libs 111 INCLUDEPATH += /usr/local/include 112 LIBS += -L/usr/local/lib -lboost_program_options-mt 113 } 114 else { 115 LIBS += -lboost_program_options 116 } 117} 118else { 119 message(Building using static Boost libraries at $$BOOST_PATH) 120 121 SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp 122 123 exists( $$BOOST_PATH/libs/smart_ptr/src/sp_collector.cpp ) { 124 message( "'old' version of Boost" ) 125 SOURCES += $$BOOST_PATH/libs/smart_ptr/src/*.cpp 126 } 127 else { 128 message( "'new' version of Boost" ) 129 SOURCES += $$BOOST_PATH/libs/smart_ptr/extras/src/*.cpp 130 } 131 132 INCLUDEPATH += $$BOOST_PATH 133} 134 135FORMS += src/optionsdialog.ui 136FORMS += src/filtersdialog.ui 137 138macx { 139 # Icon for Mac 140 ICON = images/glogg.icns 141} 142else { 143 # For Windows icon 144 RC_ICONS = glogg48.ico 145 QMAKE_TARGET_COMPANY = "Nicolas Bonnefon" 146 QMAKE_TARGET_DESCRIPTION = "glogg - the fast, smart log explorer" 147} 148 149RESOURCES = glogg.qrc 150 151# Build HTML documentation (if 'markdown' is available) 152system(type markdown >/dev/null) { 153 MARKDOWN += doc/documentation.markdown 154} 155else { 156 message("markdown not found, HTML doc will not be generated") 157} 158 159doc_processor.name = markdown 160doc_processor.input = MARKDOWN 161doc_processor.output = doc/${QMAKE_FILE_BASE}.html 162doc_processor.commands = markdown ${QMAKE_FILE_NAME} | \ 163 sed -f finish.sed >${QMAKE_FILE_OUT} 164 165doc_processor.CONFIG += target_predeps 166doc_processor.variable_out = doc.files 167 168QMAKE_EXTRA_COMPILERS += doc_processor 169 170# Install (for unix) 171icon16.path = $$PREFIX/share/icons/hicolor/16x16/apps 172icon16.files = images/hicolor/16x16/glogg.png 173 174icon32.path = $$PREFIX/share/icons/hicolor/32x32/apps 175icon32.files = images/hicolor/32x32/glogg.png 176 177icon_svg.path = $$PREFIX/share/icons/hicolor/scalable/apps 178icon_svg.files = images/hicolor/scalable/glogg.svg 179 180doc.path = $$PREFIX/share/doc/glogg 181doc.files += README.md COPYING 182 183desktop.path = $$PREFIX/share/applications 184desktop.files = glogg.desktop 185 186target.path = $$PREFIX/bin 187INSTALLS = target icon16 icon32 icon_svg doc desktop 188 189# Build directories 190CONFIG(debug, debug|release) { 191 DESTDIR = debug 192} else { 193 DESTDIR = release 194} 195 196OBJECTS_DIR = $${OUT_PWD}/.obj/$${DESTDIR}-shared 197MOC_DIR = $${OUT_PWD}/.moc/$${DESTDIR}-shared 198UI_DIR = $${OUT_PWD}/.ui/$${DESTDIR}-shared 199 200# Debug symbols even in release build 201QMAKE_CXXFLAGS = -g 202 203CONFIG += c++11 204 205# Extra compiler arguments 206# QMAKE_CXXFLAGS += -Weffc++ 207QMAKE_CXXFLAGS += -Wextra 208 209GPROF { 210 QMAKE_CXXFLAGS += -pg 211 QMAKE_LFLAGS += -pg 212} 213 214isEmpty(LOG_LEVEL) { 215 CONFIG(debug, debug|release) { 216 DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG4\" 217 } else { 218 DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\" 219 } 220} 221else { 222 message("Using specified log level: $$LOG_LEVEL") 223 DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\" 224} 225 226macx { 227 QMAKE_CXXFLAGS += -stdlib=libc++ 228 QMAKE_LFLAGS += -stdlib=libc++ 229 230 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.8 231 232 QMAKE_INFO_PLIST = Info.plist 233} 234 235# Official builds can be generated with `qmake VERSION="1.2.3"' 236isEmpty(VERSION):system(date >/dev/null) { 237 system([ -f .tarball-version ]) { 238 QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\" 239 } 240 else { 241 QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\" 242 QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\" 243 QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\" 244 } 245} 246else { 247 QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\" 248} 249 250# Optional features (e.g. CONFIG+=no-dbus) 251system(pkg-config --exists Qt5DBus):!no-dbus { 252 message("Support for D-BUS will be included") 253 QT += dbus 254 QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_DBUS 255 SOURCES += src/dbusexternalcom.cpp 256 HEADERS += src/dbusexternalcom.h 257} 258else { 259 message("Support for D-BUS will NOT be included") 260 win32 | macx { 261 message("Support for cross-platform IPC will be included") 262 QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_SOCKETIPC 263 SOURCES += src/socketexternalcom.cpp 264 HEADERS += src/socketexternalcom.h 265 } 266} 267 268# Version checking 269version_checker { 270 message("Version checker will be included") 271 QT += network 272 QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_VERSION_CHECKING 273 SOURCES += src/versionchecker.cpp 274 HEADERS += src/versionchecker.h 275} 276else { 277 message("Version checker will NOT be included") 278} 279 280# File watching 281linux-g++ | linux-g++-64 { 282 CONFIG += inotify 283} 284 285macx { 286 CONFIG += kqueue 287} 288 289win32 { 290 message("File watching using Windows") 291 SOURCES += src/platformfilewatcher.cpp src/winwatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp 292 HEADERS += src/platformfilewatcher.h src/winwatchtowerdriver.h src/watchtower.h src/watchtowerlist.h 293 QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_POLLING 294} 295else { 296 inotify { 297 message("File watching using inotify") 298 QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_INOTIFY 299 SOURCES += src/platformfilewatcher.cpp src/inotifywatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp 300 HEADERS += src/platformfilewatcher.h src/inotifywatchtowerdriver.h src/watchtower.h src/watchtowerlist.h 301 } 302 else { 303 macx { 304 message("File watching using kqueue") 305 QMAKE_CXXFLAGS += -DGLOGG_SUPPORTS_KQUEUE 306 SOURCES += src/platformfilewatcher.cpp src/kqueuewatchtowerdriver.cpp src/watchtower.cpp src/watchtowerlist.cpp 307 HEADERS += src/platformfilewatcher.h src/kqueuewatchtowerdriver.h src/watchtower.h src/watchtowerlist.h 308 } 309 else { 310 message("File watching using Qt") 311 SOURCES += src/qtfilewatcher.cpp 312 HEADERS += src/qtfilewatcher.h 313 } 314 } 315} 316 317# Performance measurement 318perf { 319 QMAKE_CXXFLAGS += -DGLOGG_PERF_MEASURE_FPS 320} 321