b27a4e083fabac847911f72a766bf84efdda5972
[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(SRCS
14         ./src/notification.c
15         ./src/notification_noti.c
16         ./src/notification_ongoing.c
17         ./src/notification_group.c
18         ./src/notification_db.c
19         ./src/notification_list.c
20         ./src/notification_status.c
21         ./src/notification_ipc.c
22         ./src/notification_setting.c
23         ./src/notification_setting_service.c
24         ./src/notification_internal.c
25         ./src/notification_error.c)
26 SET(HEADERS-DEVEL
27         ./include/notification.h
28         ./include/notification_internal.h
29         ./include/notification_db.h
30         ./include/notification_error.h
31         ./include/notification_type.h
32         ./include/notification_list.h
33         ./include/notification_ongoing.h
34         ./include/notification_ongoing_flag.h
35         ./include/notification_text_domain.h
36         ./include/notification_status.h
37         ./include/notification_status_internal.h
38         ./include/notification_setting.h
39         ./include/notification_setting_internal.h
40         ./include/notification_ipc.h
41         ./include/notification_noti.h
42         ./include/notification_setting_service.h
43    )
44
45 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
46
47 INCLUDE(FindPkgConfig)
48 pkg_check_modules(pkgs REQUIRED
49         sqlite3
50         db-util
51         vconf
52         bundle
53         dlog
54         aul
55         appsvc
56         dbus-1
57         dbus-glib-1
58         appcore-common
59         capi-appfw-application
60         capi-appfw-app-manager
61         capi-appfw-package-manager
62         pkgmgr-info
63         libtzplatform-config
64         glib-2.0
65         gio-2.0
66 )
67
68 FOREACH(flag ${pkgs_CFLAGS})
69         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
70 ENDFOREACH(flag)
71
72 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -g -Wall")
73 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
74
75 SET(CMAKE_SKIP_BUILD_RPATH TRUE)
76
77 IF (HAVE_X11)
78 ADD_DEFINITIONS("-DHAVE_X11")
79 ENDIF (HAVE_X11)
80
81 IF (HAVE_WAYLAND)
82 ADD_DEFINITIONS("-DHAVE_WAYLAND")
83 ENDIF (HAVE_WAYLAND)
84
85 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
86 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${MAJOR_VER})
87 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
88 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
89
90 MESSAGE(STATUS "LIB_INSTALL_DIR: " ${LIB_INSTALL_DIR})
91
92 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
93 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
94 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
95
96 FOREACH(hfile ${HEADERS-DEVEL})
97         INSTALL(FILES ${CMAKE_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})
98 ENDFOREACH(hfile)