1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
4 SET(CMAKE_SKIP_BUILD_RPATH true)
6 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
7 SET(EXEC_PREFIX "\${prefix}")
8 SET(LIBDIR ${LIB_INSTALL_DIR})
9 SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
15 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
16 AUX_SOURCE_DIRECTORY(src SRCS)
17 LIST(REMOVE_ITEM SRCS ${INIT-SRCS})
19 INCLUDE(FindPkgConfig)
20 pkg_check_modules(pkgs REQUIRED
25 capi-appfw-package-manager
33 FOREACH(flag ${pkgs_CFLAGS})
34 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
37 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -g -Wall -Werror -Wno-error=deprecated-declarations -O2")
38 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
40 ADD_DEFINITIONS("-DBADGE_USE_DLOG")
42 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
44 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${MAJORVER})
45 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${FULLVER})
46 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
48 ADD_EXECUTABLE(badge_init ${INIT-SRCS})
49 TARGET_LINK_LIBRARIES(badge_init ${pkgs_LDFLAGS} badge "-pie")
51 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
53 CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
54 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}.pc")
55 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
56 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/
57 DESTINATION include/${PROJECT_NAME}
59 PATTERN "*_log.h" EXCLUDE
60 PATTERN "*_private.h" EXCLUDE
63 INSTALL(FILES ${CMAKE_BINARY_DIR}/11_badge-add.post DESTINATION ${SYSCONF_INSTALL_DIR}/gumd/useradd.d/)
64 INSTALL(TARGETS badge_init DESTINATION bin)