aux_source_directory(. CODE)

add_library(kyrestart SHARED ${CODE})

set_target_properties(kyrestart PROPERTIES VERSION 3.0.0 SOVERSION 3)

find_library(DBUS_LIB dbus-1)
add_executable(kyrestart-test test/kyrestart-test.c)
target_link_libraries(kyrestart systemd ${DBUS_LIB})
target_link_libraries(kyrestart-test kyrestart)
 

# 包含 GNU 安装目录设置  
include(GNUInstallDirs)

# 安装库文件  
install(TARGETS kyrestart
        DESTINATION ${CMAKE_INSTALL_LIBDIR})
# install(TARGETS kyrestart
#         DESTINATION lib/kysdk/kysdk-system)

install(FILES libkyrestart.h
        DESTINATION include/kysdk/kysdk-system)
