From: Felix Morgner Date: Wed, 15 Jan 2014 16:21:24 +0000 (+0100) Subject: added config installation X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;h=286698a99efb62ae2d247451ea4a025d89520ffe;hp=0bbf206912441eac63395a8634939cdcdb62bb9b;p=umurmur.git added config installation The umurmur.example.config file gets installed into ${CMAKE_INSTALL_PREFIX}/etc so that it is automagically found when starting umurmurd. Note, that the config file is only installed when there is no old config file found in this spot. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d100472..f0b3851 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,12 @@ include_directories(${LIBCONFIG_INCLUDE_DIR} ${PROTOBUFC_INCLUDE_DIR} ${SSLIMP_I link_directories(${LIBCONFIG_LIB_DIR} ${PROTOBUFC_LIB_DIR} ${SSLIMP_LIB_DIR}) add_executable(umurmurd ${SOURCE}) -install(TARGETS umurmurd RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") +install(TARGETS umurmurd RUNTIME DESTINATION "bin") + +find_path(OLD_CONFIG_FILE NAMES "umurmur.conf" PATHS ${CMAKE_INSTALL_PREFIX} PATH_SUFFIXES "etc") +if(NOT OLD_CONFIG_FILE) + install(FILES "umurmur.conf.example" DESTINATION "etc" RENAME "umurmur.conf") +endif(NOT OLD_CONFIG_FILE) add_definitions(${SSLIMP_CFLAGS}) target_link_libraries(umurmurd ${LIBCONFIG_LIBRARIES} ${PROTOBUFC_LIBRARIES} ${SSLIMP_LIBRARIES} ${LIBRT})