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)
+AUX_SOURCE_DIRECTORY(src SRCS)
+LIST(REMOVE_ITEM SRCS ${INIT-SRCS})
INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
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_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(DIRECTORY ${CMAKE_SOURCE_DIR}/include/
+ DESTINATION include/${PROJECT_NAME}
+ FILES_MATCHING
+ PATTERN "*_log.h" EXCLUDE
+ PATTERN "*_private.h" EXCLUDE
+ PATTERN "*.h")
INSTALL(FILES ${CMAKE_BINARY_DIR}/11_badge-add.post DESTINATION ${SYSCONF_INSTALL_DIR}/gumd/useradd.d/)
INSTALL(TARGETS badge_init DESTINATION bin)