summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungha Son <seungha.son@samsung.com>2017-11-15 00:17:33 (GMT)
committerSeungha Son <seungha.son@samsung.com>2017-11-17 06:43:22 (GMT)
commite9b73fc40198f078aba567ed26780f3517f6b957 (patch)
treefd0bfd1d277ba050fea7c10963d787f950167e6b
parentb5d210e33051748a3cd87490fab7bae17eec5a8b (diff)
downloadbadge-e9b73fc40198f078aba567ed26780f3517f6b957.zip
badge-e9b73fc40198f078aba567ed26780f3517f6b957.tar.gz
badge-e9b73fc40198f078aba567ed26780f3517f6b957.tar.bz2
Arrange CmakeLists.txtrefs/changes/83/160183/3
Signed-off-by: Seungha Son <seungha.son@samsung.com> Change-Id: Iff4ed8cd3c9e399ad1153423e7a55b8ae1b9b185
-rwxr-xr-xCMakeLists.txt45
1 files changed, 8 insertions, 37 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b631c96..4bea017 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,44 +1,15 @@
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
@@ -60,7 +31,6 @@ FOREACH(flag ${pkgs_CFLAGS})
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")
@@ -74,16 +44,17 @@ 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(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)