summaryrefslogtreecommitdiff
path: root/email-ipc/CMakeLists.txt
blob: 1b50a6071ec4cbd1e7edfdccdd69ae065d068f98 (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
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(email-ipc)

SET(CMAKE_SKIP_BUILD_RPATH TRUE)

IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
	SET(CMAKE_BUILD_TYPE "Debug")
ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")

MESSAGE("")
MESSAGE(">>> current directory: ${CMAKE_CURRENT_SOURCE_DIR}")
MESSAGE(">>> Build type: ${CMAKE_BUILD_TYPE}")

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--gc-sections")

SET(IPC-LIB "email-ipc")
SET(IPC-SRCS
	${CMAKE_SOURCE_DIR}/email-ipc/email-ipc-api.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-ipc-build.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-ipc-proxy.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-ipc-stub.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-ipc-api/email-ipc-api-info.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-ipc-api/email-ipc-param.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-ipc-api/email-ipc-param-list.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-proxy/email-proxy-callback-info.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-proxy/email-proxy-main.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-proxy/email-proxy-socket.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-socket/email-ipc-socket.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-stub/email-stub-main.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-stub/email-stub-socket.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-stub/email-stub-task.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-stub/email-stub-task-manager.c
	${CMAKE_SOURCE_DIR}/email-ipc/email-activation/email-dbus-activation.c
)

INCLUDE_DIRECTORIES(
	${CMAKE_SOURCE_DIR}/email-daemon/include
	${CMAKE_SOURCE_DIR}/email-ipc/include
	${CMAKE_SOURCE_DIR}/email-ipc/email-proxy/include
	${CMAKE_SOURCE_DIR}/email-ipc/email-stub/include
	${CMAKE_SOURCE_DIR}/email-ipc/email-socket/include
	${CMAKE_SOURCE_DIR}/email-ipc/email-ipc-api/include
	${CMAKE_SOURCE_DIR}/email-ipc/email-activation/include
	${CMAKE_SOURCE_DIR}/email-common-use/include
	${CMAKE_SOURCE_DIR}/email-api/include
	${CMAKE_SOURCE_DIR}/email-core/email-storage/include/
	${CMAKE_SOURCE_DIR}/email-core/include/
)

INCLUDE(FindPkgConfig)
pkg_check_modules(ipc_pkgs REQUIRED dlog dbus-1 glib-2.0 libsystemd-daemon contacts-service2)

FOREACH(flag ${ipc_pkgs_CFLAGS})
	SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")

ADD_DEFINITIONS("-DBRSDK_VER=\"2\"")

SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")

ADD_LIBRARY(${IPC-LIB} SHARED ${IPC-SRCS})
TARGET_LINK_LIBRARIES(${IPC-LIB} ${ipc_pkgs_LDFLAGS} email-common-use pthread)
SET_TARGET_PROPERTIES(${IPC-LIB} PROPERTIES SOVERSION ${VERSION_MAJOR})
SET_TARGET_PROPERTIES(${IPC-LIB} PROPERTIES VERSION ${VERSION})

INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/email-activation/email-service.service DESTINATION share/dbus-1/services)
INSTALL(TARGETS ${IPC-LIB} DESTINATION lib COMPONENT RuntimeLibraries)