xref: /glogg/glogg.pro (revision 461e6185e6ab93cb1ef128bdcdcff0d996cf6326)
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 \
290876bc40SNicolas Bonnefon    filewatcher.cpp \
30*461e6185SNicolas Bonnefon    selection.cpp \
31*461e6185SNicolas Bonnefon    quickfind.cpp
329a361c77SNicolas Bonnefon
339a361c77SNicolas BonnefonHEADERS += version.h \
349a361c77SNicolas Bonnefon    mainwindow.h \
359a361c77SNicolas Bonnefon    crawlerwidget.h \
369a361c77SNicolas Bonnefon    logmainview.h \
379a361c77SNicolas Bonnefon    log.h \
389a361c77SNicolas Bonnefon    filteredview.h \
399a361c77SNicolas Bonnefon    abstractlogdata.h \
409a361c77SNicolas Bonnefon    logdata.h \
419a361c77SNicolas Bonnefon    logfiltereddata.h \
429a361c77SNicolas Bonnefon    abstractlogview.h \
439a361c77SNicolas Bonnefon    optionsdialog.h \
449a361c77SNicolas Bonnefon    configuration.h \
459a361c77SNicolas Bonnefon    filtersdialog.h \
469a361c77SNicolas Bonnefon    filterset.h \
470ef7fbb1SNicolas Bonnefon    savedsearches.h \
4862819106SNicolas Bonnefon    infoline.h \
49f35c72b9SNicolas Bonnefon    logdataworkerthread.h \
50d0d26f4fSNicolas Bonnefon    logfiltereddataworkerthread.h \
510876bc40SNicolas Bonnefon    filewatcher.h \
52*461e6185SNicolas Bonnefon    selection.h \
53*461e6185SNicolas Bonnefon    quickfind.h
549a361c77SNicolas Bonnefon
553e90fb01SNicolas BonnefonisEmpty(USE_NATIVE_BOOST) {
563e90fb01SNicolas Bonnefon    message(Building using static Boost libraries included in the tarball)
573e90fb01SNicolas Bonnefon
583e90fb01SNicolas Bonnefon    SOURCES += boost/libs/program_options/src/*.cpp \
593e90fb01SNicolas Bonnefon        boost/libs/detail/*.cpp \
603e90fb01SNicolas Bonnefon        boost/libs/smart_ptr/src/*.cpp
613e90fb01SNicolas Bonnefon
623e90fb01SNicolas Bonnefon    INCLUDEPATH += ./boost
633e90fb01SNicolas Bonnefon}
643e90fb01SNicolas Bonnefonelse {
653e90fb01SNicolas Bonnefon    message(Building using native dynamic Boost libraries)
663e90fb01SNicolas Bonnefon    LIBS += -lboost_program_options -L$HOME/lib/
673e90fb01SNicolas Bonnefon}
683e90fb01SNicolas Bonnefon
699a361c77SNicolas BonnefongreaterThan(QT_VERSION, "4.4.0") {
709a361c77SNicolas Bonnefon    FORMS += filtersdialog.ui
719a361c77SNicolas Bonnefon}
729a361c77SNicolas Bonnefonelse {
739a361c77SNicolas Bonnefon    message(Using old FiltersDialog)
749a361c77SNicolas Bonnefon    FORMS += filtersdialog_old.ui
759a361c77SNicolas Bonnefon}
769a361c77SNicolas Bonnefon
7736b4ae36SNicolas Bonnefon# For Windows icon
7836b4ae36SNicolas BonnefonRC_FILE = glogg.rc
799a361c77SNicolas BonnefonRESOURCES = glogg.qrc
809a361c77SNicolas Bonnefon
81458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available)
82458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) {
83458a6a73SNicolas Bonnefon    MARKDOWN += doc/documentation.markdown
84458a6a73SNicolas Bonnefon}
85458a6a73SNicolas Bonnefonelse {
86458a6a73SNicolas Bonnefon    message("markdown not found, HTML doc will not be generated")
87458a6a73SNicolas Bonnefon}
88458a6a73SNicolas Bonnefon
89458a6a73SNicolas Bonnefondoc_processor.name = markdown
90458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN
91458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html
92458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
93458a6a73SNicolas Bonnefon    sed -f finish.sed >${QMAKE_FILE_OUT}
94458a6a73SNicolas Bonnefon
95458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps
96458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files
97458a6a73SNicolas Bonnefon
98458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor
99458a6a73SNicolas Bonnefon
100b5a5d5faSNicolas Bonnefon# Install (for unix)
101fca14737SNicolas Bonnefonicon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
102fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png
103fca14737SNicolas Bonnefon
104fca14737SNicolas Bonnefonicon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
105fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png
106fca14737SNicolas Bonnefon
107fca14737SNicolas Bonnefondoc.path  = $$PREFIX/share/doc/glogg
108458a6a73SNicolas Bonnefondoc.files += README COPYING
109fca14737SNicolas Bonnefon
110fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications
11176bf9e67SNicolas Bonnefondesktop.files = glogg.desktop
112fca14737SNicolas Bonnefon
113b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin
114fca14737SNicolas BonnefonINSTALLS = target icon16 icon32 doc desktop
115b5a5d5faSNicolas Bonnefon
116b5a5d5faSNicolas Bonnefon# Build directories
1179a361c77SNicolas Bonnefondebug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
1189a361c77SNicolas Bonnefonrelease:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
1199a361c77SNicolas Bonnefondebug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared
1209a361c77SNicolas Bonnefonrelease:MOC_DIR = $${OUT_PWD}/.moc/release-shared
1219a361c77SNicolas Bonnefon
12259d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) {
1239a361c77SNicolas Bonnefon    Release:DEFINES += FILELOG_MAX_LEVEL=\"logERROR\"
1249a361c77SNicolas Bonnefon    Debug:DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\"
12559d49dccSNicolas Bonnefon}
12659d49dccSNicolas Bonnefonelse {
12759d49dccSNicolas Bonnefon    message("Using specified log level: $$LOG_LEVEL")
12859d49dccSNicolas Bonnefon    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
12959d49dccSNicolas Bonnefon}
1309a361c77SNicolas Bonnefon
131b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"'
132ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) {
133afcc2cb7SNicolas Bonnefon    system([ -f .tarball-version ]) {
134afcc2cb7SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
135afcc2cb7SNicolas Bonnefon    }
136afcc2cb7SNicolas Bonnefon    else {
137b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
138b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
139b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
140b5a5d5faSNicolas Bonnefon    }
141afcc2cb7SNicolas Bonnefon}
142b5a5d5faSNicolas Bonnefonelse {
14321a1b6dcSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
144b5a5d5faSNicolas Bonnefon}
145458a6a73SNicolas Bonnefon
146