xref: /glogg/glogg.pro (revision a0560bdd7b312657c44f8aef73b00b43be2a75ef)
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 \
221685bbd1SNicolas Bonnefon    persistentinfo.cpp \
239a361c77SNicolas Bonnefon    configuration.cpp \
249a361c77SNicolas Bonnefon    filtersdialog.cpp \
259a361c77SNicolas Bonnefon    filterset.cpp \
260ef7fbb1SNicolas Bonnefon    savedsearches.cpp \
2762819106SNicolas Bonnefon    infoline.cpp \
28f35c72b9SNicolas Bonnefon    logdataworkerthread.cpp \
29d0d26f4fSNicolas Bonnefon    logfiltereddataworkerthread.cpp \
300876bc40SNicolas Bonnefon    filewatcher.cpp \
31461e6185SNicolas Bonnefon    selection.cpp \
328fa6737cSNicolas Bonnefon    quickfind.cpp \
338fa6737cSNicolas Bonnefon    quickfindpattern.cpp \
34a0230d5fSNicolas Bonnefon    quickfindwidget.cpp \
354f52d4dcSNicolas Bonnefon    sessioninfo.cpp \
36*a0560bddSNicolas Bonnefon    recentfiles.cpp \
37*a0560bddSNicolas Bonnefon    overview.cpp
389a361c77SNicolas Bonnefon
396e94dd7aSNicolas BonnefonHEADERS += \
409a361c77SNicolas Bonnefon    mainwindow.h \
419a361c77SNicolas Bonnefon    crawlerwidget.h \
429a361c77SNicolas Bonnefon    logmainview.h \
439a361c77SNicolas Bonnefon    log.h \
449a361c77SNicolas Bonnefon    filteredview.h \
459a361c77SNicolas Bonnefon    abstractlogdata.h \
469a361c77SNicolas Bonnefon    logdata.h \
479a361c77SNicolas Bonnefon    logfiltereddata.h \
489a361c77SNicolas Bonnefon    abstractlogview.h \
499a361c77SNicolas Bonnefon    optionsdialog.h \
501685bbd1SNicolas Bonnefon    persistentinfo.h \
519a361c77SNicolas Bonnefon    configuration.h \
529a361c77SNicolas Bonnefon    filtersdialog.h \
539a361c77SNicolas Bonnefon    filterset.h \
540ef7fbb1SNicolas Bonnefon    savedsearches.h \
5562819106SNicolas Bonnefon    infoline.h \
56f35c72b9SNicolas Bonnefon    logdataworkerthread.h \
57d0d26f4fSNicolas Bonnefon    logfiltereddataworkerthread.h \
580876bc40SNicolas Bonnefon    filewatcher.h \
59461e6185SNicolas Bonnefon    selection.h \
608fa6737cSNicolas Bonnefon    quickfind.h \
618fa6737cSNicolas Bonnefon    quickfindpattern.h \
621685bbd1SNicolas Bonnefon    quickfindwidget.h \
63a0230d5fSNicolas Bonnefon    sessioninfo.h \
644f52d4dcSNicolas Bonnefon    persistable.h \
65*a0560bddSNicolas Bonnefon    recentfiles.h \
66*a0560bddSNicolas Bonnefon    overview.h
679a361c77SNicolas Bonnefon
682f3d4448SNicolas BonnefonisEmpty(BOOST_PATH) {
692f3d4448SNicolas Bonnefon    message(Building using system dynamic Boost libraries)
704b0730ffSNicolas Bonnefon    LIBS += -lboost_program_options
713e90fb01SNicolas Bonnefon}
723e90fb01SNicolas Bonnefonelse {
732f3d4448SNicolas Bonnefon    message(Building using static Boost libraries at $$BOOST_PATH)
742f3d4448SNicolas Bonnefon
752f3d4448SNicolas Bonnefon    SOURCES += $$BOOST_PATH/libs/program_options/src/*.cpp \
762f3d4448SNicolas Bonnefon        $$BOOST_PATH/libs/detail/*.cpp \
772f3d4448SNicolas Bonnefon        $$BOOST_PATH/libs/smart_ptr/src/*.cpp
782f3d4448SNicolas Bonnefon
792f3d4448SNicolas Bonnefon    INCLUDEPATH += $$BOOST_PATH
803e90fb01SNicolas Bonnefon}
813e90fb01SNicolas Bonnefon
8226e566eaSNicolas BonnefonFORMS += optionsdialog.ui
8326e566eaSNicolas Bonnefon
849a361c77SNicolas BonnefongreaterThan(QT_VERSION, "4.4.0") {
859a361c77SNicolas Bonnefon    FORMS += filtersdialog.ui
869a361c77SNicolas Bonnefon}
879a361c77SNicolas Bonnefonelse {
889a361c77SNicolas Bonnefon    message(Using old FiltersDialog)
899a361c77SNicolas Bonnefon    FORMS += filtersdialog_old.ui
909a361c77SNicolas Bonnefon}
919a361c77SNicolas Bonnefon
9236b4ae36SNicolas Bonnefon# For Windows icon
9336b4ae36SNicolas BonnefonRC_FILE = glogg.rc
949a361c77SNicolas BonnefonRESOURCES = glogg.qrc
959a361c77SNicolas Bonnefon
96458a6a73SNicolas Bonnefon# Build HTML documentation (if 'markdown' is available)
97458a6a73SNicolas Bonnefonsystem(type markdown >/dev/null) {
98458a6a73SNicolas Bonnefon    MARKDOWN += doc/documentation.markdown
99458a6a73SNicolas Bonnefon}
100458a6a73SNicolas Bonnefonelse {
101458a6a73SNicolas Bonnefon    message("markdown not found, HTML doc will not be generated")
102458a6a73SNicolas Bonnefon}
103458a6a73SNicolas Bonnefon
104458a6a73SNicolas Bonnefondoc_processor.name = markdown
105458a6a73SNicolas Bonnefondoc_processor.input = MARKDOWN
106458a6a73SNicolas Bonnefondoc_processor.output = doc/${QMAKE_FILE_BASE}.html
107458a6a73SNicolas Bonnefondoc_processor.commands = markdown ${QMAKE_FILE_NAME} | \
108458a6a73SNicolas Bonnefon    sed -f finish.sed >${QMAKE_FILE_OUT}
109458a6a73SNicolas Bonnefon
110458a6a73SNicolas Bonnefondoc_processor.CONFIG += target_predeps
111458a6a73SNicolas Bonnefondoc_processor.variable_out = doc.files
112458a6a73SNicolas Bonnefon
113458a6a73SNicolas BonnefonQMAKE_EXTRA_COMPILERS += doc_processor
114458a6a73SNicolas Bonnefon
115b5a5d5faSNicolas Bonnefon# Install (for unix)
116fca14737SNicolas Bonnefonicon16.path  = $$PREFIX/share/icons/hicolor/16x16/apps
117fca14737SNicolas Bonnefonicon16.files = images/hicolor/16x16/glogg.png
118fca14737SNicolas Bonnefon
119fca14737SNicolas Bonnefonicon32.path  = $$PREFIX/share/icons/hicolor/32x32/apps
120fca14737SNicolas Bonnefonicon32.files = images/hicolor/32x32/glogg.png
121fca14737SNicolas Bonnefon
122fca14737SNicolas Bonnefondoc.path  = $$PREFIX/share/doc/glogg
123458a6a73SNicolas Bonnefondoc.files += README COPYING
124fca14737SNicolas Bonnefon
125fca14737SNicolas Bonnefondesktop.path = $$PREFIX/share/applications
12676bf9e67SNicolas Bonnefondesktop.files = glogg.desktop
127fca14737SNicolas Bonnefon
128b5a5d5faSNicolas Bonnefontarget.path = $$PREFIX/bin
129fca14737SNicolas BonnefonINSTALLS = target icon16 icon32 doc desktop
130b5a5d5faSNicolas Bonnefon
131b5a5d5faSNicolas Bonnefon# Build directories
1329a361c77SNicolas Bonnefondebug:OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
1339a361c77SNicolas Bonnefonrelease:OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared
1349a361c77SNicolas Bonnefondebug:MOC_DIR = $${OUT_PWD}/.moc/debug-shared
1359a361c77SNicolas Bonnefonrelease:MOC_DIR = $${OUT_PWD}/.moc/release-shared
1369a361c77SNicolas Bonnefon
137f1ff9ae1SNicolas Bonnefon# Debug symbols in debug builds
138f1ff9ae1SNicolas Bonnefondebug:QMAKE_CXXFLAGS += -g
139f1ff9ae1SNicolas Bonnefon
14059d49dccSNicolas BonnefonisEmpty(LOG_LEVEL) {
1419a361c77SNicolas Bonnefon    Release:DEFINES += FILELOG_MAX_LEVEL=\"logERROR\"
1429a361c77SNicolas Bonnefon    Debug:DEFINES += FILELOG_MAX_LEVEL=\"logDEBUG\"
14359d49dccSNicolas Bonnefon}
14459d49dccSNicolas Bonnefonelse {
14559d49dccSNicolas Bonnefon    message("Using specified log level: $$LOG_LEVEL")
14659d49dccSNicolas Bonnefon    DEFINES += FILELOG_MAX_LEVEL=\"$$LOG_LEVEL\"
14759d49dccSNicolas Bonnefon}
1489a361c77SNicolas Bonnefon
149b5a5d5faSNicolas Bonnefon# Official builds can be generated with `qmake VERSION="1.2.3"'
150ab07219fSNicolas BonnefonisEmpty(VERSION):system(date >/dev/null) {
151afcc2cb7SNicolas Bonnefon    system([ -f .tarball-version ]) {
152afcc2cb7SNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`cat .tarball-version`\\\"
153afcc2cb7SNicolas Bonnefon    }
154afcc2cb7SNicolas Bonnefon    else {
155b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_DATE=\\\"`date +'\"%F\"'`\\\"
156b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"`git describe`\\\"
157b5a5d5faSNicolas Bonnefon        QMAKE_CXXFLAGS += -DGLOGG_COMMIT=\\\"`git rev-parse --short HEAD`\\\"
158b5a5d5faSNicolas Bonnefon    }
159afcc2cb7SNicolas Bonnefon}
160b5a5d5faSNicolas Bonnefonelse {
16121a1b6dcSNicolas Bonnefon    QMAKE_CXXFLAGS += -DGLOGG_VERSION=\\\"$$VERSION\\\"
162b5a5d5faSNicolas Bonnefon}
163458a6a73SNicolas Bonnefon
164