#-------------------------------------------------
#
# Project created by QtCreator 2014-11-29T08:31:41
#
#-------------------------------------------------

QT       += core gui widgets sql svg network xml printsupport qml websockets concurrent

# quick is enabled for more scripting options
# Windows and macOS seem to ignore that
# It looks like it is needed for Qt 6 for macOS, see https://github.com/pbek/QOwnNotes/issues/2912#issuecomment-3094868110
greaterThan(QT_MAJOR_VERSION, 5) {
QT       += quick
}

CONFIG += with_aspell
DEFINES += LANGUAGETOOL_ENABLED
DEFINES += HARPER_ENABLED

# QLiteHtml requires Qt 6+
greaterThan(QT_MAJOR_VERSION, 5) {
    CONFIG += USE_QLITEHTML
}

# enable pch for DEV_MODE
# put any dev specific options here
CONFIG(DEV_MODE) {
    message("[DevMode] PCH Enabled")
    CONFIG += precompile_header
    PRECOMPILED_HEADER  = pch.h
    HEADERS += pch.h
}

CONFIG(USE_QLITEHTML) {
    message("QLiteHtml usage enabled")
    DEFINES += USE_QLITEHTML=1
    include(libraries/qlitehtml/src/qlitehtml.pri)
}

include(libraries/qtkeychain/qtkeychain.pri)
INCLUDEPATH += $$PWD/libraries/qtkeychain
lessThan(QT_VERSION, 5.15.0) {
    # qtkeychain references QDataStream::Qt_5_15, which is unavailable in legacy Qt 5 builds.
    DEFINES += Qt_5_15=Qt_5_0
}

TARGET = QOwnNotes
TEMPLATE = app
ICON = QOwnNotes.icns
RC_FILE = QOwnNotes.rc
TRANSLATIONS = languages/QOwnNotes_en.ts \
    languages/QOwnNotes_de.ts \
    languages/QOwnNotes_fr.ts \
    languages/QOwnNotes_zh_CN.ts \
    languages/QOwnNotes_zh_TW.ts \
    languages/QOwnNotes_pl.ts \
    languages/QOwnNotes_ru.ts \
    languages/QOwnNotes_es.ts \
    languages/QOwnNotes_pt_BR.ts \
    languages/QOwnNotes_pt_PT.ts \
    languages/QOwnNotes_nl.ts \
    languages/QOwnNotes_hu.ts \
    languages/QOwnNotes_ja.ts \
    languages/QOwnNotes_it.ts \
    languages/QOwnNotes_ar.ts \
    languages/QOwnNotes_uk.ts \
    languages/QOwnNotes_cs.ts \
    languages/QOwnNotes_hr.ts \
    languages/QOwnNotes_ca.ts \
    languages/QOwnNotes_sv.ts \
    languages/QOwnNotes_id.ts \
    languages/QOwnNotes_bn.ts \
    languages/QOwnNotes_tr.ts \
    languages/QOwnNotes_tl.ts \
    languages/QOwnNotes_fil.ts \
    languages/QOwnNotes_ceb.ts \
    languages/QOwnNotes_hi.ts \
    languages/QOwnNotes_hil.ts \
    languages/QOwnNotes_ur.ts \
    languages/QOwnNotes_fi.ts \
    languages/QOwnNotes_el.ts \
    languages/QOwnNotes_gl.ts \
    languages/QOwnNotes_no.ts \
    languages/QOwnNotes_da.ts \
    languages/QOwnNotes_ro.ts \
    languages/QOwnNotes_sl.ts \
    languages/QOwnNotes_sk.ts \
    languages/QOwnNotes_eu.ts \
    languages/QOwnNotes_sr.ts \
    languages/QOwnNotes_fa.ts \
    languages/QOwnNotes_ha.ts \
    languages/QOwnNotes_bg.ts \
    languages/QOwnNotes_is.ts \
    languages/QOwnNotes_pa.ts \
    languages/QOwnNotes_he.ts \
    languages/QOwnNotes_yi.ts \
    languages/QOwnNotes_th.ts \
    languages/QOwnNotes_sn.ts \
    languages/QOwnNotes_km.ts \
    languages/QOwnNotes_si.ts \
    languages/QOwnNotes_zu.ts \
    languages/QOwnNotes_xh.ts \
    languages/QOwnNotes_ms.ts \
    languages/QOwnNotes_mi.ts \
    languages/QOwnNotes_ga.ts \
    languages/QOwnNotes_uz.ts \
    languages/QOwnNotes_vi.ts \
    languages/QOwnNotes_lv.ts \
    languages/QOwnNotes_ku.ts \
    languages/QOwnNotes_lt.ts \
    languages/QOwnNotes_bs.ts \
    languages/QOwnNotes_mk.ts \
    languages/QOwnNotes_ko.ts \
    languages/QOwnNotes_et.ts \
    languages/QOwnNotes_sq.ts \
    languages/QOwnNotes_en_GB.ts

CODECFORTR = UTF-8
lessThan(QT_MAJOR_VERSION, 6) {
    CONFIG += c++11

    # for older Qt versions
    win32-msvc {
        QMAKE_CXXFLAGS += "/std:c++11"
    } else {
        QMAKE_CXXFLAGS += "-std=c++11"
    }
} else {
    win32:CONFIG += entrypoint
    CONFIG += c++17
}

INCLUDEPATH += $$PWD/libraries $$PWD/libraries/diff_match_patch

SOURCES += main.cpp\
    helpers/nomenuiconstyle.cpp \
    dialogs/attachmentdialog.cpp \
    dialogs/nextclouddeckdialog.cpp \
    entities/cloudconnection.cpp \
    helpers/codetohtmlconverter.cpp \
    helpers/qownspellchecker.cpp \
        mainwindow.cpp \
    libraries/diff_match_patch/diff_match_patch.cpp \
    libraries/simplecrypt/simplecrypt.cpp \
    libraries/versionnumber/versionnumber.cpp \
    libraries/botan/botanwrapper.cpp \
    libraries/md4c/src/md4c.c \
    libraries/md4c/src/md4c-html.c \
    libraries/md4c/src/entity.c \
    libraries/qtwaitingspinner/waitingspinnerwidget.cpp \
    dialogs/aboutdialog.cpp \
    dialogs/linkdialog.cpp \
    dialogs/notediffdialog.cpp \
    dialogs/textdiffdialog.cpp \
    dialogs/settingsdialog.cpp \
    dialogs/tododialog.cpp \
    dialogs/trashdialog.cpp \
    dialogs/localtrashdialog.cpp \
    dialogs/updatedialog.cpp \
    dialogs/versiondialog.cpp \
    entities/calendaritem.cpp \
    entities/note.cpp \
    entities/trashitem.cpp \
    entities/notesubfolder.cpp \
    entities/notehistory.cpp \
     entities/notefolder.cpp \
    entities/colormode.cpp \
    entities/tag.cpp \
    entities/script.cpp \
    entities/bookmark.cpp \
    entities/commandsnippet.cpp \
    services/cloudservice.cpp \
    services/nextclouddeckservice.cpp \
    services/updateservice.cpp \
    helpers/htmlentities.cpp \
    helpers/clientproxy.cpp \
    helpers/toolbarcontainer.cpp \
    helpers/qownnotesmarkdownhighlighter.cpp \
    helpers/fakevimproxy.cpp \
    helpers/flowlayout.cpp \
    services/languagetoolclient.cpp \
    services/languagetoolchecker.cpp \
    services/harperclient.cpp \
    services/harperchecker.cpp \
    services/databaseservice.cpp \
    services/markdownlspignoredrules.cpp \
    threads/scriptthread.cpp \
    widgets/graphicsview.cpp \
    widgets/qownnotesmarkdowntextedit.cpp \
    dialogs/passworddialog.cpp \
    services/metricsservice.cpp \
    services/cryptoservice.cpp \
    services/scriptingservice.cpp \
    services/websocketserverservice.cpp \
    services/webappclientservice.cpp \
     services/openaiservice.cpp \
    services/markdownlspclient.cpp \
    services/markdownlspdocumenttracker.cpp \
    services/mcpservice.cpp \
    services/settingsservice.cpp \
    dialogs/masterdialog.cpp \
    utils/misc.cpp \
    utils/git.cpp \
    utils/gui.cpp \
    utils/cli.cpp \
    utils/listutils.cpp \
    utils/schema.cpp \
    dialogs/welcomedialog.cpp \
    dialogs/issueassistantdialog.cpp \
    dialogs/tagadddialog.cpp \
    widgets/navigationwidget.cpp \
    widgets/filenavigationwidget.cpp \
    widgets/backlinkwidget.cpp \
    widgets/notepreviewwidget.cpp \
    api/noteapi.cpp \
    api/notesubfolderapi.cpp \
    api/tagapi.cpp \
    widgets/logwidget.cpp \
    widgets/combobox.cpp \
    dialogs/sharedialog.cpp \
    widgets/fontcolorwidget.cpp \
    dialogs/evernoteimportdialog.cpp \
    dialogs/joplinimportdialog.cpp \
    dialogs/storedimagesdialog.cpp \
    dialogs/storedattachmentsdialog.cpp \
    dialogs/actiondialog.cpp \
    dialogs/tabledialog.cpp \
    dialogs/markdowntabledialog.cpp \
    libraries/qtcsv/src/sources/reader.cpp \
    dialogs/notedialog.cpp \
    dialogs/notebookmarkdialog.cpp \
    dialogs/filedialog.cpp \
    dialogs/scriptrepositorydialog.cpp \
    dialogs/dictionarymanagerdialog.cpp \
    widgets/scriptsettingwidget.cpp \
    api/scriptapi.cpp \
    widgets/label.cpp \
    widgets/notefilepathlabel.cpp \
    widgets/qrcodewidget.cpp \
    widgets/lineedit.cpp \
    widgets/passwordlineedit.cpp \
    widgets/qtexteditsearchwidget.cpp \
    widgets/scriptlistwidget.cpp \
    widgets/notefolderlistwidget.cpp \
    widgets/notetreewidgetitem.cpp \
    widgets/todoitemtreewidget.cpp \
    widgets/layoutpresetwidget.cpp \
    widgets/htmlpreviewwidget.cpp \
    widgets/settings/colormodesettingswidget.cpp \
    widgets/settings/gitsettingswidget.cpp \
    widgets/settings/localtrashsettingswidget.cpp \
    widgets/settings/debugoptionsettingswidget.cpp \
    widgets/settings/editorfontcolorsettingswidget.cpp \
    widgets/settings/previewfontsettingswidget.cpp \
    widgets/settings/debugsettingswidget.cpp \
    widgets/settings/languagetoolsettingswidget.cpp \
    widgets/settings/harpersettingswidget.cpp \
    widgets/settings/markdownlspsettingswidget.cpp \
     widgets/settings/networksettingswidget.cpp \
     widgets/settings/cloudsettingswidget.cpp \
     widgets/settings/todosettingswidget.cpp \
    widgets/settings/aisettingswidget.cpp \
    widgets/settings/webcompanionsettingswidget.cpp \
    widgets/settings/editorsettingswidget.cpp \
    widgets/settings/webapplicationsettingswidget.cpp \
    widgets/settings/mcpserversettingswidget.cpp \
    widgets/settings/notefoldersettingswidget.cpp \
     widgets/settings/panelssettingswidget.cpp \
     widgets/settings/interfacesettingswidget.cpp \
     widgets/settings/generalsettingswidget.cpp \
     widgets/settings/scriptingsettingswidget.cpp \
    dialogs/serverbookmarksimportdialog.cpp \
    dialogs/websockettokendialog.cpp \
    dialogs/imagedialog.cpp \
    dialogs/commandbar.cpp \
    dialogs/layoutdialog.cpp \
    models/commandmodel.cpp \
    libraries/fuzzy/kfuzzymatcher.cpp \
    libraries/qr-code-generator/QrCode.cpp \
    widgets/notesubfoldertree.cpp \
    widgets/noterelationscene.cpp \
    managers/spellcheckmanager.cpp \
    managers/systemtraymanager.cpp \
    managers/exportprintmanager.cpp \
    managers/noteencryptionmanager.cpp \
    managers/distractionfreemanager.cpp \
    managers/notetabmanager.cpp \
    managers/aitoolbarmanager.cpp \
    managers/layoutmanager.cpp \
    managers/tagmanager.cpp \
    managers/noteoperationsmanager.cpp \
    managers/noteindexmanager.cpp \
    managers/searchfiltermanager.cpp \
    managers/mediainsertionmanager.cpp \
    managers/navigationmanager.cpp \
    managers/notetreemanager.cpp \
    utils/urlhandler.cpp

HEADERS  += mainwindow.h \
    helpers/nomenuiconstyle.h \
    build_number.h \
    dialogs/attachmentdialog.h \
    dialogs/nextclouddeckdialog.h \
    entities/cloudconnection.h \
    helpers/LanguageCache.h \
    helpers/codetohtmlconverter.h \
    helpers/qownspellchecker.h \
    threads/scriptthread.h \
    version.h \
    libraries/diff_match_patch/diff_match_patch.h \
    libraries/simplecrypt/simplecrypt.h \
    libraries/versionnumber/versionnumber.h \
    libraries/botan/botanwrapper.h \
    libraries/md4c/src/md4c.h \
    libraries/md4c/src/md4c-html.h \
    libraries/md4c/src/entity.h \
    entities/notehistory.h \
    entities/note.h \
    entities/trashitem.h \
    entities/notesubfolder.h \
    entities/calendaritem.h \
    entities/notefolder.h \
    entities/colormode.h \
    entities/tag.h \
    entities/script.h \
    entities/bookmark.h \
    entities/commandsnippet.h \
    dialogs/aboutdialog.h \
    dialogs/linkdialog.h \
    dialogs/notediffdialog.h \
    dialogs/textdiffdialog.h \
    dialogs/settingsdialog.h \
    dialogs/tododialog.h \
    dialogs/trashdialog.h \
    dialogs/localtrashdialog.h \
    dialogs/updatedialog.h \
    dialogs/versiondialog.h \
    services/cloudservice.h \
    services/nextclouddeckservice.h \
    services/updateservice.h \
    services/scriptingservice.h \
    services/websocketserverservice.h \
    services/webappclientservice.h \
    services/languagetoolclient.h \
    services/languagetoolchecker.h \
    services/languagetooltypes.h \
    services/harperclient.h \
    services/harperchecker.h \
    services/harpertypes.h \
    helpers/htmlentities.h \
    helpers/clientproxy.h \
    helpers/toolbarcontainer.h \
    helpers/qownnotesmarkdownhighlighter.h \
    helpers/fakevimproxy.h \
    helpers/flowlayout.h \
    services/databaseservice.h \
    release.h \
    widgets/graphicsview.h \
    widgets/qownnotesmarkdowntextedit.h \
    dialogs/passworddialog.h \
    services/metricsservice.h \
    services/cryptoservice.h \
     services/openaiservice.h \
    services/markdownlspignoredrules.h \
    services/markdownlspclient.h \
    services/markdownlspdocumenttracker.h \
    services/mcpservice.h \
    services/settingsservice.h \
    dialogs/masterdialog.h \
    utils/misc.h \
    utils/git.h \
    utils/gui.h \
    utils/cli.h \
    utils/listutils.h \
    utils/schema.h \
    dialogs/welcomedialog.h \
    dialogs/issueassistantdialog.h \
    dialogs/tagadddialog.h \
    widgets/navigationwidget.h \
    widgets/filenavigationwidget.h \
    widgets/backlinkwidget.h \
    widgets/notepreviewwidget.h \
    api/noteapi.h \
    api/notesubfolderapi.h \
    api/tagapi.h \
    widgets/logwidget.h \
    widgets/combobox.h \
    dialogs/sharedialog.h \
    widgets/fontcolorwidget.h \
    dialogs/evernoteimportdialog.h \
    dialogs/joplinimportdialog.h \
    dialogs/storedimagesdialog.h \
    dialogs/storedattachmentsdialog.h \
    dialogs/actiondialog.h \
    dialogs/tabledialog.h \
    dialogs/markdowntabledialog.h \
    libraries/qtcsv/src/include/qtcsv_global.h \
    libraries/qtcsv/src/include/abstractdata.h \
    libraries/qtcsv/src/include/reader.h \
    libraries/qtcsv/src/sources/filechecker.h \
    libraries/qtcsv/src/sources/symbols.h \
    dialogs/notedialog.h \
    dialogs/notebookmarkdialog.h \
    dialogs/filedialog.h \
    dialogs/scriptrepositorydialog.h \
    dialogs/dictionarymanagerdialog.h \
    widgets/scriptsettingwidget.h \
    api/scriptapi.h \
    widgets/label.h \
    widgets/notefilepathlabel.h \
    widgets/qrcodewidget.h \
    widgets/lineedit.h \
    widgets/passwordlineedit.h \
    widgets/qtexteditsearchwidget.h \
    widgets/scriptlistwidget.h \
    widgets/notefolderlistwidget.h \
    widgets/notetreewidgetitem.h \
    widgets/todoitemtreewidget.h \
    widgets/layoutpresetwidget.h \
    widgets/htmlpreviewwidget.h \
    widgets/settings/colormodesettingswidget.h \
    widgets/settings/gitsettingswidget.h \
    widgets/settings/localtrashsettingswidget.h \
    widgets/settings/debugoptionsettingswidget.h \
    widgets/settings/editorfontcolorsettingswidget.h \
    widgets/settings/previewfontsettingswidget.h \
    widgets/settings/debugsettingswidget.h \
    widgets/settings/languagetoolsettingswidget.h \
    widgets/settings/harpersettingswidget.h \
    widgets/settings/markdownlspsettingswidget.h \
     widgets/settings/networksettingswidget.h \
     widgets/settings/cloudsettingswidget.h \
     widgets/settings/todosettingswidget.h \
    widgets/settings/aisettingswidget.h \
    widgets/settings/webcompanionsettingswidget.h \
    widgets/settings/editorsettingswidget.h \
    widgets/settings/webapplicationsettingswidget.h \
    widgets/settings/mcpserversettingswidget.h \
    widgets/settings/notefoldersettingswidget.h \
     widgets/settings/panelssettingswidget.h \
     widgets/settings/interfacesettingswidget.h \
     widgets/settings/generalsettingswidget.h \
     widgets/settings/scriptingsettingswidget.h \
    dialogs/serverbookmarksimportdialog.h \
    dialogs/websockettokendialog.h \
    dialogs/imagedialog.h \
    dialogs/commandbar.h \
    dialogs/layoutdialog.h \
    models/commandmodel.h \
    libraries/fuzzy/kfuzzymatcher.h \
    libraries/qr-code-generator/QrCode.hpp \
    libraries/qtwaitingspinner/waitingspinnerwidget.h \
    widgets/notesubfoldertree.h \
    widgets/noterelationscene.h \
    managers/spellcheckmanager.h \
    managers/systemtraymanager.h \
    managers/exportprintmanager.h \
    managers/noteencryptionmanager.h \
    managers/distractionfreemanager.h \
    managers/notetabmanager.h \
    managers/aitoolbarmanager.h \
    managers/layoutmanager.h \
    managers/tagmanager.h \
    managers/noteoperationsmanager.h \
    managers/noteindexmanager.h \
    managers/searchfiltermanager.h \
    managers/mediainsertionmanager.h \
    managers/navigationmanager.h \
    managers/notetreemanager.h \
    utils/urlhandler.h \

FORMS    += mainwindow.ui \
    dialogs/attachmentdialog.ui \
    dialogs/imagedialog.ui \
    dialogs/nextclouddeckdialog.ui \
    dialogs/notediffdialog.ui \
    dialogs/textdiffdialog.ui \
    dialogs/aboutdialog.ui \
    dialogs/updatedialog.ui \
    dialogs/settingsdialog.ui \
    dialogs/versiondialog.ui \
    dialogs/trashdialog.ui \
    dialogs/localtrashdialog.ui \
    dialogs/linkdialog.ui \
    dialogs/tododialog.ui \
    dialogs/passworddialog.ui \
    dialogs/welcomedialog.ui \
    dialogs/issueassistantdialog.ui \
    dialogs/tagadddialog.ui \
    widgets/logwidget.ui \
    dialogs/sharedialog.ui \
    widgets/fontcolorwidget.ui \
    dialogs/evernoteimportdialog.ui \
    dialogs/joplinimportdialog.ui \
    dialogs/storedimagesdialog.ui \
    dialogs/storedattachmentsdialog.ui \
    dialogs/actiondialog.ui \
    dialogs/tabledialog.ui \
    dialogs/markdowntabledialog.ui \
    dialogs/notedialog.ui \
   dialogs/notebookmarkdialog.ui \
    dialogs/scriptrepositorydialog.ui \
    dialogs/dictionarymanagerdialog.ui \
    widgets/qtexteditsearchwidget.ui \
    widgets/scriptsettingwidget.ui \
    widgets/notetreewidgetitem.ui \
    widgets/layoutpresetwidget.ui \
    widgets/settings/colormodesettingswidget.ui \
    widgets/settings/gitsettingswidget.ui \
    widgets/settings/localtrashsettingswidget.ui \
    widgets/settings/debugoptionsettingswidget.ui \
    widgets/settings/editorfontcolorsettingswidget.ui \
    widgets/settings/previewfontsettingswidget.ui \
    widgets/settings/debugsettingswidget.ui \
    widgets/settings/languagetoolsettingswidget.ui \
    widgets/settings/harpersettingswidget.ui \
    widgets/settings/markdownlspsettingswidget.ui \
     widgets/settings/networksettingswidget.ui \
     widgets/settings/cloudsettingswidget.ui \
     widgets/settings/todosettingswidget.ui \
    widgets/settings/aisettingswidget.ui \
    widgets/settings/webcompanionsettingswidget.ui \
    widgets/settings/editorsettingswidget.ui \
    widgets/settings/webapplicationsettingswidget.ui \
    widgets/settings/mcpserversettingswidget.ui \
    widgets/settings/notefoldersettingswidget.ui \
     widgets/settings/panelssettingswidget.ui \
     widgets/settings/interfacesettingswidget.ui \
     widgets/settings/generalsettingswidget.ui \
     widgets/settings/scriptingsettingswidget.ui \
    dialogs/serverbookmarksimportdialog.ui \
    dialogs/websockettokendialog.ui \
    dialogs/layoutdialog.ui

RESOURCES += \
    images.qrc \
    texts.qrc \
    breeze-qownnotes.qrc \
    breeze-dark-qownnotes.qrc \
    qownnotes.qrc \
    demonotes.qrc \
    libraries/qdarkstyle/style.qrc \
    configurations.qrc

include(libraries/qmarkdowntextedit/qmarkdowntextedit.pri)
include(libraries/piwiktracker/piwiktracker.pri)
include(libraries/botan/botan.pri)
include(libraries/qkeysequencewidget/qkeysequencewidget/qkeysequencewidget.pri)
include(libraries/qttoolbareditor/toolbar_editor.pri)
include(libraries/fakevim/fakevim.pri)
include(libraries/singleapplication/singleapplication.pri)
include(libraries/sonnet/src/core/sonnet-core.pri)
include(libraries/qhotkey/qhotkey.pri)

# XDG Desktop Portal global shortcuts support for Wayland on Linux
unix:!mac {
    QT += dbus
    SOURCES += services/xdgglobalshortcutmanager.cpp
    HEADERS += services/xdgglobalshortcutmanager.h
}

unix {
  isEmpty(PREFIX) {
    PREFIX = /usr
  }

  isEmpty(BINDIR) {
    BINDIR = $$PREFIX/bin
  }

  isEmpty(DATADIR) {
    DATADIR = $$PREFIX/share
  }

  INSTALLS += target desktop i18n icons

  target.path = $$INSTROOT$$BINDIR
#  target.files += QOwnNotes

  desktop.path = $$DATADIR/applications

  # Don't add desktop file when building snap
  !CONFIG(snapcraft, snapcraft) {
      desktop.files += PBE.QOwnNotes.desktop
  }

  # The qt5/qt6 paths qre needed by the Fedora and openSUSE builds on OBS
  # Keep in mind that Debian and Ubuntu don't work with those paths with cmake and Qt6
  lessThan(QT_MAJOR_VERSION, 6) {
      i18n.path = $$DATADIR/qt5/translations
  } else {
      i18n.path = $$DATADIR/qt6/translations
  }
  i18n.files += languages/*.qm

  icons.path = $$DATADIR/icons/hicolor
  icons.files += images/icons/*
}

!win32-msvc: QMAKE_CXXFLAGS += "-Wall -Wextra -Wundef"

# Enable Werror on unixes except mac
CONFIG(DEV_MODE) {
    unix:!mac {
        message("Werror enabled")
        QMAKE_CXXFLAGS += "-Wno-error=deprecated-declarations -Werror -pedantic"

        # Suppress specific warnings-as-errors for 3rdparty litehtml/gumbo code
        # These must come AFTER -Werror to take effect
        CONFIG(USE_QLITEHTML) {
            QMAKE_CXXFLAGS += -Wno-error=unused-parameter -Wno-error=missing-field-initializers \
                -Wno-error=sign-compare -Wno-error=unused-but-set-variable
        }

        # Suppress warnings-as-errors from bundled qtkeychain sources
        QMAKE_CXXFLAGS += -Wno-error=cast-function-type -Wno-error=switch
    }
}

CONFIG(debug, debug|release) {
#    QMAKE_CXXFLAGS_DEBUG += -g3 -O0
    message("Currently in DEBUG mode.")
    DEFINES += QT_DEBUG
} else {
    DEFINES += QT_NO_DEBUG

    # We want to allow optional debug output in releases
#    DEFINES += QT_NO_DEBUG_OUTPUT
    message("Currently in RELEASE mode.")
}

DEFINES += QAPPLICATION_CLASS=QApplication

DISTFILES += \
    ../README.md \
    ../CHANGELOG.md
