CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(badge C) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "\${prefix}") SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(PROJECT_NAME "${PROJECT_NAME}") SET(LIBDIR ${LIB_INSTALL_DIR}) SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}") SET(CMAKE_SKIP_BUILD_RPATH true) SET(INSTALL_HEADERS_DEVEL badge.h badge_error.h badge_internal.h badge_db.h badge_setting.h badge_setting_service.h badge_ipc.h ) SET(INIT-SRCS src/badge_init.c ) SET(SRCS src/badge.c src/badge_error.c src/badge_db.c src/badge_ipc.c src/badge_internal.c src/badge_setting.c src/badge_setting_service.c ) SET(SUBMODULES_DEVEL badge badge-service ) INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) INCLUDE(FindPkgConfig) pkg_check_modules(pkgs REQUIRED aul dlog dbus-1 dbus-glib-1 vconf capi-appfw-package-manager capi-system-info db-util libtzplatform-config pkgmgr-info libsmack ) FOREACH(flag ${pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -g -Wall -Werror -Wno-error=deprecated-declarations -O2") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE") ADD_DEFINITIONS("-DBADGE_USE_DLOG") ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${MAJORVER}) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${FULLVER}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS}) ADD_EXECUTABLE(badge_init ${INIT-SRCS}) TARGET_LINK_LIBRARIES(badge_init ${pkgs_LDFLAGS} badge "-pie") MESSAGE(${LIB_INSTALL_DIR} ====) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR}) CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY) SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc") INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) FOREACH(hfile ${INSTALL_HEADERS_DEVEL}) INSTALL(FILES ${CMAKE_SOURCE_DIR}/include/${hfile} DESTINATION include/${PROJECT_NAME}) ENDFOREACH(hfile) INSTALL(FILES ${CMAKE_BINARY_DIR}/11_badge-add.post DESTINATION ${SYSCONF_INSTALL_DIR}/gumd/useradd.d/) INSTALL(TARGETS badge_init DESTINATION bin)