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(DBDIR "/opt/dbspace")
10 SET(DBFILE ".notification.db")
12 SET(VERSION ${MAJOR_VER}.1.0)
14 SET(SRCS ./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 SET(HEADERS ./include/notification.h
21 ./include/notification_error.h
22 ./include/notification_type.h
23 ./include/notification_list.h)
25 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
27 INCLUDE(FindPkgConfig)
28 pkg_check_modules(pkgs REQUIRED sqlite3 db-util heynoti vconf bundle dbus-1 dlog ail aul appsvc)
30 FOREACH(flag ${pkgs_CFLAGS})
31 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
34 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -g -Wall")
35 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
37 SET(CMAKE_SKIP_BUILD_RPATH TRUE)
39 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
40 ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"")
41 ADD_DEFINITIONS("-DDBDIR=\"${DBDIR}\"")
42 ADD_DEFINITIONS("-DDBFILE=\"${DBFILE}\"")
44 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
45 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${MAJOR_VER})
46 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
47 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
49 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
51 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT RuntimeLibraries)
52 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
53 FOREACH(hfile ${HEADERS})
54 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})