1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(notification C)
4 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
5 SET(EXEC_PREFIX "\${prefix}")
6 SET(LIBDIR "\${prefix}/lib")
7 SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
8 SET(ICONDIR "${PREFIX}/share/${PROJECT_NAME}")
9 SET(RESDIR "${PREFIX}/share/${PROJECT_NAME}")
10 SET(DBDIR "/opt/dbspace")
11 SET(IMGDIR "${RESDIR}/images")
12 SET(DBFILE ".notification.db")
14 SET(VERSION ${MAJOR_VER}.1.0)
16 # ADD_SUBDIRECTORY(test-app)
20 ./src/notification_noti.c
21 ./src/notification_ongoing.c
22 ./src/notification_group.c
23 ./src/notification_db.c
24 ./src/notification_list.c
25 ./src/notification_status.c
26 ./src/notification_ipc.c
27 ./src/notification_setting.c)
29 ./include/notification.h
30 ./include/notification_internal.h
31 ./include/notification_error.h
32 ./include/notification_type.h
33 ./include/notification_list.h
34 ./include/notification_status.h
35 ./include/notification_setting.h
39 SET(HEADERS-SERVICE-DEVEL
40 ./include/notification_ipc.h
41 ./include/notification_noti.h
42 ./include/notification_setting_service.h)
44 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
46 INCLUDE(FindPkgConfig)
47 pkg_check_modules(pkgs REQUIRED
59 capi-appfw-application
60 capi-appfw-package-manager
67 FOREACH(flag ${pkgs_CFLAGS})
68 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
71 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -g -Wall")
72 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
74 SET(CMAKE_SKIP_BUILD_RPATH TRUE)
76 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
77 ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"")
78 ADD_DEFINITIONS("-DDBDIR=\"${DBDIR}\"")
79 ADD_DEFINITIONS("-DDBFILE=\"${DBFILE}\"")
80 ADD_DEFINITIONS("-DIMGDIR=\"${IMGDIR}\"")
82 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
83 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${MAJOR_VER})
84 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
85 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
87 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
88 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT RuntimeLibraries)
89 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
91 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/images/ DESTINATION ${IMGDIR} FILES_MATCHING PATTERN "*.png")
93 FOREACH(hfile ${HEADERS-DEVEL})
94 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})
97 CONFIGURE_FILE(${PROJECT_NAME}-service.pc.in ${PROJECT_NAME}-service.pc @ONLY)
98 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-service.pc DESTINATION lib/pkgconfig)
100 FOREACH(hfile ${HEADERS-SERVICE-DEVEL})
101 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME}/service)