common.pri 2.44 KB
Newer Older
1
QMAKE_CXXFLAGS += -Werror
2
CONFIG += link_pkgconfig
3
PKGCONFIG += \
4
    libsailfishkeyprovider \
5 6
    libsignon-qt5 \
    accounts-qt5 \
7 8 9 10 11 12 13 14
    buteosyncfw5 \
    socialcache

QT += \
    network \
    dbus \
    sql

15 16 17
QT -= \
    gui

18 19
QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF

20
# the unit tests need to provide a custom QNAM and uses a different database directory
21
HEADERS += $$PWD/common/socialdnetworkaccessmanager_p.h
22
!contains(DEFINES, 'SOCIALD_TEST_DEFINE') {
23
    SOURCES += $$PWD/common/socialdnetworkaccessmanager_p.cpp
24 25 26 27 28 29
    DEFINES += 'PRIVILEGED_DATA_DIR=\'\"/home/nemo/.local/share/system/privileged/\"\''
}

DEFINES += 'SYNC_DATABASE_DIR=\'\"Sync\"\''
DEFINES += 'SOCIALD_SYNC_DATABASE_NAME=\'\"sociald.db\"\''

30 31
INCLUDEPATH += . $$PWD/common/

32
HEADERS += \
33
    $$PWD/common/buteosyncfw_p.h \
34 35 36
    $$PWD/common/socialdbuteoplugin.h \
    $$PWD/common/socialnetworksyncadaptor.h \
    $$PWD/common/trace.h
37 38

SOURCES += \
39 40
    $$PWD/common/socialdbuteoplugin.cpp \
    $$PWD/common/socialnetworksyncadaptor.cpp
41

42 43 44 45 46 47
contains(DEFINES, 'SOCIALD_USE_QTPIM') {
    DEFINES *= USE_CONTACTS_NAMESPACE=QTCONTACTS_USE_NAMESPACE
    PKGCONFIG += Qt5Contacts qtcontacts-sqlite-qt5-extensions
    HEADERS += $$PWD/common/constants_p.h
}

48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
# don't pull in buteo plugin framework for unit test builds
!contains (DEFINES, 'SOCIALD_TEST_DEFINE') {
    !contains (DEFINES, OUT_OF_PROCESS_PLUGIN) {
        TEMPLATE = lib
        CONFIG += plugin
        target.path = /usr/lib/buteo-plugins-qt5
        message("building" $$TARGET "as in-process plugin")
    }
    contains (DEFINES, OUT_OF_PROCESS_PLUGIN) {
        TEMPLATE = app
        target.path = /usr/lib/buteo-plugins-qt5/oopp
        message("building" $$TARGET "as out-of-process plugin")

        DEFINES += CLIENT_PLUGIN
        BUTEO_OOPP_INCLUDE_DIR = $$system(pkg-config --cflags buteosyncfw5|cut -f2 -d'I')
        INCLUDEPATH += $$BUTEO_OOPP_INCLUDE_DIR

        HEADERS += $$BUTEO_OOPP_INCLUDE_DIR/ButeoPluginIfaceAdaptor.h   \
                   $$BUTEO_OOPP_INCLUDE_DIR/PluginCbImpl.h              \
                   $$BUTEO_OOPP_INCLUDE_DIR/PluginServiceObj.h

        SOURCES += $$BUTEO_OOPP_INCLUDE_DIR/ButeoPluginIfaceAdaptor.cpp \
                   $$BUTEO_OOPP_INCLUDE_DIR/PluginCbImpl.cpp            \
                   $$BUTEO_OOPP_INCLUDE_DIR/PluginServiceObj.cpp        \
                   $$BUTEO_OOPP_INCLUDE_DIR/plugin_main.cpp
    }
}

76
#NOTE: This causes issues with the unit tests ?
77 78
#MOC_DIR = $$PWD/../.moc
#OBJECTS_DIR = $$PWD/../.obj