xref: /glogg/glogg.pro (revision 0876bc400d38173ffeff2958e2984b476be4071c)
19a361c77SNicolas Bonnefon# -------------------------------------------------
29a361c77SNicolas Bonnefon# glogg
39a361c77SNicolas Bonnefon# -------------------------------------------------
49a361c77SNicolas BonnefonTARGET = glogg
59a361c77SNicolas BonnefonTEMPLATE = app
69a361c77SNicolas Bonnefon
79a361c77SNicolas Bonnefonwin32:Debug:CONFIG += console
83597d419SNicolas Bonnefon# Necessary when cross-compiling:
93597d419SNicolas Bonnefonwin32:Release:QMAKE_LFLAGS += "-Wl,-subsystem,windows"
109a361c77SNicolas Bonnefon
119a361c77SNicolas Bonnefon# Input
129a361c77SNicolas BonnefonSOURCES += main.cpp \
139a361c77SNicolas Bonnefon    mainwindow.cpp \
149a361c77SNicolas Bonnefon    crawlerwidget.cpp \
159a361c77SNicolas Bonnefon    abstractlogdata.cpp \
169a361c77SNicolas Bonnefon    logdata.cpp \
179a361c77SNicolas Bonnefon    logfiltereddata.cpp \
189a361c77SNicolas Bonnefon    abstractlogview.cpp \
199a361c77SNicolas Bonnefon    logmainview.cpp \
209a361c77SNicolas Bonnefon    filteredview.cpp \
219a361c77SNicolas Bonnefon    optionsdialog.cpp \
229a361c77SNicolas Bonnefon    configuration.cpp \
239a361c77SNicolas Bonnefon    filtersdialog.cpp \
249a361c77SNicolas Bonnefon    filterset.cpp \
250ef7fbb1SNicolas Bonnefon    savedsearches.cpp \
2662819106SNicolas Bonnefon    infoline.cpp \
27f35c72b9SNicolas Bonnefon    logdataworkerthread.cpp \
28d0d26f4fSNicolas Bonnefon    logfiltereddataworkerthread.cpp \
29*0876bc40SNicolas Bonnefon    filewatcher.cpp \
30*0876bc40SNicolas Bonnefon    selection.cpp
319a361c77SNicolas Bonnefon
329a361c77SNicolas BonnefonHEADERS += version.h \
339a361c77SNicolas Bonnefon    mainwindow.h \
349a361c77SNicolas Bonnefon    crawlerwidget.h \
359a361c77SNicolas Bonnefon    logmainview.h \
369a361c77SNicolas Bonnefon    log.h \
379a361c77SNicolas Bonnefon    filteredview.h \
389a361c77SNicolas Bonnefon    abstractlogdata.h \
399a361c77SNicolas Bonnefon    logdata.h \
409a361c77SNicolas Bonnefon    logfiltereddata.h \
419a361c77SNicolas Bonnefon    abstractlogview.h \
429a361c77SNicolas Bonnefon    optionsdialog.h \
439a361c77SNicolas Bonnefon    configuration.h \
449a361c77SNicolas Bonnefon    filtersdialog.h \
459a361c77SNicolas Bonnefon    filterset.h \
460ef7fbb1SNicolas Bonnefon    savedsearches.h \
4762819106SNicolas Bonnefon    infoline.h \
48f35c72b9SNicolas Bonnefon    logdataworkerthread.h \
49d0d26f4fSNicolas Bonnefon    logfiltereddataworkerthread.h \
50*0876bc40SNicolas Bonnefon    filewatcher.h \
51*0876bc40SNicolas Bonnefon    selection.h
529a361c77SNicolas Bonnefon
533e90fb01SNicolas BonnefonisEmpty(USE_NATIVE_BOOST) {
543e90fb01SNicolas Bonnefon    message(Building using static Boost libraries included in the tarball)
553e90fb01SNicolas Bonnefon
563e90fb01SNicolas Bonnefon    SOURCES += boost/libs/program_options/src/*.cpp \
573e90fb01SNicolas Bonnefon        boost/libs/detail/*.cpp \
583e90fb01SNicolas Bonnefon        boost/libs/smart_ptr/src/*.cpp
593e90fb01SNicolas Bonnefon
603e90fb01SNicolas Bonnefon    INCLUDEPATH += ./boost
613e90fb01SNicolas Bonnefon}
623e90fb01SNicolas Bonnefonelse {
633e90fb01SNicolas Bonnefon    message(Building using native dynamic Boost libraries)
643e90fb01SNicolas Bonnefon    LIBS += -lboost_program_options -L$HOME/lib/
653e90fb01SNicolas Bonnefon}
663e90fb01SNicolas Bonnefon
679a361c77SNicolas BonnefongreaterThan(QT_VERSION, "4.4.0") {
689a361c77SNicolas Bonnefon    FORMS += filtersdialog.ui
699a361c77SNicolas Bonnefon}
709a361c77SNicolas Bonnefonelse {
719a361c77SNicolas Bonnefon    message(Using old FiltersDialog)
729a361c77SNicolas Bonnefon    FORMS += filtersdialog_old.ui
739a361c77SNicolas Bonnefon}
749a361c77SNicolas Bonnefon
7536b4ae36SNicolas Bonnefon# For Windows icon
7636b4ae36SNicolas BonnefonRC_FILE = glogg.rc
779a361c77SNicolas BonnefonRESOURCES = glogg.qrc
789a361c77SNicolas Bonnefon
79458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available)
80458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) {
81458a6a73SNicolas Bonnefon    MARKDOWN += doc/documentation.markdown
82458a6a73SNicolas Bonnefon}
83458a6a73SNicolas Bonnefonelse {
84458a6a73SNicolas Bonnefon    message("markdown not found, HTML doc will not be generated")
85458a6a73SNicolas Bonnefon}
86458a6a73SNicolas Bonnefon
87458a6a73SNicolas Bonnefondoc_processor.name = markdown
88458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN
89458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html
90458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
91458a6a73SNicolas Bonnefon    sed -f finish.sed >${QMAKE_FILE_OUT}
92458a6a73SNicolas Bonnefon
93458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps
94458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files
95458a6a73SNicolas Bonnefon
96458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor
97458a6a73SNicolas Bonnefon
98b5a5d5faSNicolas Bonnefon# Install (for unix)
99fca14737SNicolas Bonnefonicon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
100fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png
101fca14737SNicolas Bonnefon
102fca14737SNicolas Bonnefonicon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
103fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png
104fca14737SNicolas Bonnefon
105fca14737SNicolas Bonnefondoc.path  = $$PREFIX/share/doc/glogg
106458a6a73SNicolas Bonnefondoc.files += README COPYING
107fca14737SNicolas Bonnefon
108fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications
10976bf9e67SNicolas Bonnefondesktop.files = glogg.desktop
110fca14737SNicolas Bonnefon
111b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin
112fca14737SNicolas BonnefonINSTALLS = target icon16 icon32 doc desktop
113b5a5d5faSNicolas Bonnefon
114b5a5d5faSNicolas Bonnefon# Build directories
1159a361c77SNicolas Bonnefondebug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
1169a361c77SNicolas Bonnefonrelease:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
1179a361c77SNicolas Bonnefondebug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared
1189a361c77SNicolas Bonnefonrelease:MOC_DIR = $${OUT_PWD}/.moc/release-shared
1199a361c77SNicolas Bonnefon
12059d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) {
1219a361c77SNicolas Bonnefon    Release:DEFINES += FILELOG_MAX_LEVEL=\"logERROR\"
1229a361c77SNicolas Bonnefon    Debug:DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\"
12359d49dccSNicolas Bonnefon}
12459d49dccSNicolas Bonnefonelse {
12559d49dccSNicolas Bonnefon    message("Using specified log level: $$LOG_LEVEL")
12659d49dccSNicolas Bonnefon    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
12759d49dccSNicolas Bonnefon}
1289a361c77SNicolas Bonnefon
129b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"'
130ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) {
131afcc2cb7SNicolas Bonnefon    system([ -f .tarball-version ]) {
132afcc2cb7SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
133afcc2cb7SNicolas Bonnefon    }
134afcc2cb7SNicolas Bonnefon    else {
135b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
136b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
137b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
138b5a5d5faSNicolas Bonnefon    }
139afcc2cb7SNicolas Bonnefon}
140b5a5d5faSNicolas Bonnefonelse {
14121a1b6dcSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
142b5a5d5faSNicolas Bonnefon}
143458a6a73SNicolas Bonnefon
144