1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
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}")
11 SET(CMAKE_SKIP_BUILD_RPATH true)
13 SET(INSTALL_HEADERS_DEVEL
19 badge_setting_service.h
34 src/badge_setting_service.c
41 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
43 INCLUDE(FindPkgConfig)
44 pkg_check_modules(pkgs REQUIRED
50 capi-appfw-package-manager
57 FOREACH(flag ${pkgs_CFLAGS})
58 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
61 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -g -Wall -Werror -Wno-error=deprecated-declarations -O2")
63 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
65 ADD_DEFINITIONS("-DBADGE_USE_DLOG")
67 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
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})
73 ADD_EXECUTABLE(badge_init ${INIT-SRCS})
74 TARGET_LINK_LIBRARIES(badge_init ${pkgs_LDFLAGS} badge)
76 MESSAGE(${LIB_INSTALL_DIR} ====)
77 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
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)
83 FOREACH(hfile ${INSTALL_HEADERS_DEVEL})
84 INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/${hfile} DESTINATION include/${PROJECT_NAME})
87 INSTALL(FILES ${CMAKE_BINARY_DIR}/11_badge-add.post DESTINATION ${SYSCONF_INSTALL_DIR}/gumd/useradd.d/)
88 INSTALL(TARGETS badge_init DESTINATION bin)