summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 9bd1961bd3e8534f1c8b64238134c5fd052ca407 (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
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(notification C)

SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "\${prefix}")
SET(LIBDIR ${LIB_INSTALL_DIR})
SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
SET(MAJOR_VER 0)
SET(VERSION ${MAJOR_VER}.1.0)

ADD_SUBDIRECTORY(test-app)

SET(INIT-SRCS
	./src/notification_init.c
)

SET(SRCS
	./src/notification.c
	./src/notification_noti.c
	./src/notification_ongoing.c
	./src/notification_group.c
	./src/notification_db.c
	./src/notification_list.c
	./src/notification_status.c
	./src/notification_ipc.c
	./src/notification_setting.c
	./src/notification_setting_service.c
	./src/notification_internal.c
	./src/notification_error.c)
SET(HEADERS-DEVEL
	./include/notification.h
	./include/notification_internal.h
	./include/notification_db.h
	./include/notification_error.h
	./include/notification_type.h
	./include/notification_list.h
	./include/notification_ongoing.h
	./include/notification_ongoing_flag.h
	./include/notification_text_domain.h
	./include/notification_status.h
	./include/notification_status_internal.h
	./include/notification_setting.h
	./include/notification_setting_internal.h
	./include/notification_ipc.h
	./include/notification_noti.h
	./include/notification_setting_service.h
   )

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)

INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
	sqlite3
	db-util
	vconf
	bundle
	dlog
	aul
	appsvc
	dbus-1
	dbus-glib-1
	appcore-common
	capi-appfw-application
	capi-appfw-app-manager
	capi-appfw-package-manager
	pkgmgr-info
	libtzplatform-config
	glib-2.0
	gio-2.0
)

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

SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -g -Wall")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")

SET(CMAKE_SKIP_BUILD_RPATH TRUE)

IF (HAVE_X11)
ADD_DEFINITIONS("-DHAVE_X11")
ENDIF (HAVE_X11)

IF (HAVE_WAYLAND)
ADD_DEFINITIONS("-DHAVE_WAYLAND")
ENDIF (HAVE_WAYLAND)

ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${MAJOR_VER})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})

ADD_EXECUTABLE(notification_init ${INIT-SRCS})
TARGET_LINK_LIBRARIES(notification_init ${pkgs_LDFLAGS} notification)

MESSAGE(STATUS "LIB_INSTALL_DIR: " ${LIB_INSTALL_DIR})

CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)

FOREACH(hfile ${HEADERS-DEVEL})
	INSTALL(FILES ${CMAKE_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})
ENDFOREACH(hfile)

INSTALL(FILES ${CMAKE_BINARY_DIR}/11_notification-add.post DESTINATION ${SYSCONF_INSTALL_DIR}/gumd/useradd.d/)
INSTALL(TARGETS notification_init DESTINATION bin)