Merge "Add uid clone for notification_clone()" into tizen
[platform/core/api/notification.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(notification C)
3
4 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
5 SET(EXEC_PREFIX "\${prefix}")
6 SET(LIBDIR ${LIB_INSTALL_DIR})
7 SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
8 SET(MAJOR_VER 0)
9 SET(VERSION ${MAJOR_VER}.1.0)
10
11 ADD_SUBDIRECTORY(test-app)
12
13 SET(INIT-SRCS
14         ./src/notification_init.c
15 )
16
17 SET(SRCS
18         ./src/notification.c
19         ./src/notification_noti.c
20         ./src/notification_ongoing.c
21         ./src/notification_group.c
22         ./src/notification_db.c
23         ./src/notification_list.c
24         ./src/notification_status.c
25         ./src/notification_ipc.c
26         ./src/notification_setting.c
27         ./src/notification_setting_service.c
28         ./src/notification_internal.c
29         ./src/notification_error.c)
30 SET(HEADERS-DEVEL
31         ./include/notification.h
32         ./include/notification_internal.h
33         ./include/notification_db.h
34         ./include/notification_error.h
35         ./include/notification_type.h
36         ./include/notification_list.h
37         ./include/notification_ongoing.h
38         ./include/notification_ongoing_flag.h
39         ./include/notification_text_domain.h
40         ./include/notification_status.h
41         ./include/notification_status_internal.h
42         ./include/notification_setting.h
43         ./include/notification_setting_internal.h
44         ./include/notification_ipc.h
45         ./include/notification_noti.h
46         ./include/notification_setting_service.h
47    )
48
49 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
50
51 INCLUDE(FindPkgConfig)
52 pkg_check_modules(pkgs REQUIRED
53         sqlite3
54         db-util
55         vconf
56         bundle
57         dlog
58         aul
59         appsvc
60         dbus-1
61         dbus-glib-1
62         appcore-common
63         capi-appfw-application
64         capi-appfw-app-manager
65         capi-appfw-package-manager
66         pkgmgr-info
67         libtzplatform-config
68         glib-2.0
69         gio-2.0
70         alarm-service
71 )
72
73 FOREACH(flag ${pkgs_CFLAGS})
74         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
75 ENDFOREACH(flag)
76
77 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -g -Wall")
78 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
79
80 SET(CMAKE_SKIP_BUILD_RPATH TRUE)
81
82 IF (HAVE_X11)
83 ADD_DEFINITIONS("-DHAVE_X11")
84 ENDIF (HAVE_X11)
85
86 IF (HAVE_WAYLAND)
87 ADD_DEFINITIONS("-DHAVE_WAYLAND")
88 ENDIF (HAVE_WAYLAND)
89
90 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
91 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${MAJOR_VER})
92 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
93 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
94
95 ADD_EXECUTABLE(notification_init ${INIT-SRCS})
96 TARGET_LINK_LIBRARIES(notification_init ${pkgs_LDFLAGS} notification)
97
98 MESSAGE(STATUS "LIB_INSTALL_DIR: " ${LIB_INSTALL_DIR})
99
100 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
101 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
102 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
103
104 FOREACH(hfile ${HEADERS-DEVEL})
105         INSTALL(FILES ${CMAKE_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})
106 ENDFOREACH(hfile)
107
108 INSTALL(FILES ${CMAKE_BINARY_DIR}/11_notification-add.post DESTINATION ${SYSCONF_INSTALL_DIR}/gumd/useradd.d/)
109 INSTALL(TARGETS notification_init DESTINATION bin)