summaryrefslogtreecommitdiffstats
path: root/common/CMakeLists.txt
blob: b90ab6ad27bddf5598e01199b4a884546a21060c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(domain)

ecm_setup_version(${sink_VERSION}
    VARIABLE_PREFIX Sink
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/sink_version.h"
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/SinkConfigVersion.cmake"
    SOVERSION 0
)

########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/Sink")

configure_package_config_file(
    "${CMAKE_CURRENT_SOURCE_DIR}/SinkConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/SinkConfig.cmake"
    INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
)

install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/SinkConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/SinkConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
)

add_definitions("-fvisibility=hidden")

install(EXPORT SinkTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE SinkTargets.cmake)

set(storage_SRCS storage_lmdb.cpp)

set(command_SRCS
    store.cpp
    secretstore.cpp
    notifier.cpp
    resourcecontrol.cpp
    modelresult.cpp
    definitions.cpp
    log.cpp
    entitybuffer.cpp
    facadefactory.cpp
    commands.cpp
    facade.cpp
    pipeline.cpp
    propertymapper.cpp
    domainadaptor.cpp
    resource.cpp
    genericresource.cpp
    resourceaccess.cpp
    queryrunner.cpp
    listener.cpp
    storage_common.cpp
    threadboundary.cpp
    messagequeue.cpp
    index.cpp
    typeindex.cpp
    resourcefacade.cpp
    resourceconfig.cpp
    configstore.cpp
    resultset.cpp
    domain/propertyregistry.cpp
    domain/applicationdomaintype.cpp
    domain/typeimplementations.cpp
    test.cpp
    query.cpp
    changereplay.cpp
    adaptorfactoryregistry.cpp
    synchronizer.cpp
    synchronizerstore.cpp
    contactpreprocessor.cpp
    mailpreprocessor.cpp
    specialpurposepreprocessor.cpp
    datastorequery.cpp
    storage/entitystore.cpp
    indexer.cpp
    mail/threadindexer.cpp
    notification.cpp
    commandprocessor.cpp
    inspector.cpp
    propertyparser.cpp
    ${storage_SRCS})

add_library(${PROJECT_NAME} SHARED ${command_SRCS})

generate_flatbuffers(
    ${PROJECT_NAME}

    commands/commandcompletion
    commands/createentity
    commands/deleteentity
    commands/handshake
    commands/modifyentity
    commands/revisionupdate
    commands/synchronize
    commands/notification
    commands/revisionreplayed
    commands/inspection
    commands/flush
    commands/secret
    domain/contact
    domain/addressbook
    domain/event
    domain/mail
    domain/folder
    domain/dummy
    entity
    metadata
    queuedcommand
)

generate_export_header(${PROJECT_NAME} BASE_NAME Sink EXPORT_FILE_NAME sink_export.h)
SET_TARGET_PROPERTIES(${PROJECT_NAME}
    PROPERTIES LINKER_LANGUAGE CXX
    VERSION ${Sink_VERSION}
    SOVERSION ${Sink_SOVERSION}
    EXPORT_NAME ${PROJECT_NAME}
)

target_link_libraries(${PROJECT_NAME}
PUBLIC
    KAsync
    Qt5::Network
PRIVATE
    ${LMDB_LIBRARIES}
    Qt5::Gui
    KF5::Mime
    KF5::Contacts
)
install(TARGETS ${PROJECT_NAME}
    EXPORT SinkTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} ${LIBRARY_NAMELINK} )

add_clang_static_analysis(${PROJECT_NAME})

install(FILES
    store.h
    notifier.h
    resourcecontrol.h
    domain/applicationdomaintype.h
    query.h
    standardqueries.h
    inspection.h
    notification.h
    bufferadaptor.h
    test.h
    log.h
    flush.h
    secretstore.h
    ${CMAKE_CURRENT_BINARY_DIR}/sink_export.h
    DESTINATION ${INCLUDE_INSTALL_DIR}/${PROJECT_NAME} COMPONENT Devel
)