cmake: enabled 'make install' as a target

This commit is contained in:
Nick 2017-11-23 17:06:55 +01:00
parent 98535324fe
commit 782cd77b40

View File

@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.2)
include(CPack)
include(CheckFunctionExists)
include(CheckLibraryExists)
include(GNUInstallDirs)
project(mbusd VERSION 0.2.4)
@ -43,7 +45,6 @@ if(HAVE_TIME AND HAVE_LOCALTIME)
add_definitions(-DHRDATE)
endif()
include(CheckLibraryExists)
find_library(LIB_UTIL NAMES libutil util)
check_library_exists(util tty_get_name LIB_UTIL HAVE_TTY_GET_NAME)
check_library_exists(util uu_lock LIB_UTIL HAVE_UU_LOCK)
@ -66,4 +67,8 @@ set(mbusd_SOURCES
src/sig.c
src/sock.c
)
add_executable(mbusd ${mbusd_SOURCES})
add_executable(mbusd ${mbusd_SOURCES})
# add make install capabilites
install(TARGETS mbusd DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}/)
install(FILES doc/mbusd.8 DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man8/)