Add logic to check smack label
[platform/core/appfw/badge.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(badge C)
3
4 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
5 SET(EXEC_PREFIX "\${prefix}")
6 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
7 SET(PROJECT_NAME "${PROJECT_NAME}")
8 SET(LIBDIR ${LIB_INSTALL_DIR})
9 SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
10
11 SET(CMAKE_SKIP_BUILD_RPATH true)
12
13 SET(INSTALL_HEADERS_DEVEL
14         badge.h
15         badge_error.h
16         badge_internal.h
17         badge_db.h
18         badge_setting.h
19         badge_setting_service.h
20         badge_ipc.h
21 )
22
23 SET(INIT-SRCS
24         src/badge_init.c
25 )
26
27 SET(SRCS
28         src/badge.c
29         src/badge_error.c
30         src/badge_db.c
31         src/badge_ipc.c
32         src/badge_internal.c
33         src/badge_setting.c
34         src/badge_setting_service.c
35 )
36
37 SET(SUBMODULES_DEVEL
38         badge
39         badge-service
40 )
41 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
42
43 INCLUDE(FindPkgConfig)
44 pkg_check_modules(pkgs REQUIRED
45         aul
46         dlog
47         dbus-1
48         dbus-glib-1
49         vconf
50         capi-appfw-package-manager
51         db-util
52         libtzplatform-config
53         pkgmgr-info
54         libsmack
55 )
56
57 FOREACH(flag ${pkgs_CFLAGS})
58         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
59 ENDFOREACH(flag)
60
61 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -g -Wall -Werror -Wno-error=deprecated-declarations -O2")
62
63 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
64
65 ADD_DEFINITIONS("-DBADGE_USE_DLOG")
66
67 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
68
69 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${MAJORVER})
70 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${FULLVER})
71 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
72
73 ADD_EXECUTABLE(badge_init ${INIT-SRCS})
74 TARGET_LINK_LIBRARIES(badge_init ${pkgs_LDFLAGS} badge)
75
76 MESSAGE(${LIB_INSTALL_DIR} ====)
77 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
78
79 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
80 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc")
81 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
82
83 FOREACH(hfile ${INSTALL_HEADERS_DEVEL})
84         INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/${hfile} DESTINATION include/${PROJECT_NAME})
85 ENDFOREACH(hfile)
86
87 INSTALL(FILES ${CMAKE_BINARY_DIR}/11_badge-add.post DESTINATION ${SYSCONF_INSTALL_DIR}/gumd/useradd.d/)
88 INSTALL(TARGETS badge_init DESTINATION bin)