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 ${LIB_INSTALL_DIR})
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 ./src/notification_status.c
21 ./src/notification_ipc.c)
22 SET(HEADERS ./include/notification.h
23 ./include/notification_error.h
24 ./include/notification_type.h
25 ./include/notification_list.h
26 ./include/notification_status.h
27 ./include/notification_ipc.h
28 ./include/notification_noti.h)
30 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
32 INCLUDE(FindPkgConfig)
33 pkg_check_modules(pkgs REQUIRED
48 FOREACH(flag ${pkgs_CFLAGS})
49 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
52 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -g -Wall")
53 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
55 SET(CMAKE_SKIP_BUILD_RPATH TRUE)
57 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
58 ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"")
59 ADD_DEFINITIONS("-DDBDIR=\"${DBDIR}\"")
60 ADD_DEFINITIONS("-DDBFILE=\"${DBFILE}\"")
62 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
63 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${MAJOR_VER})
64 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
65 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
67 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
69 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
70 INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
71 FOREACH(hfile ${HEADERS})
72 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})