aux_source_directory(. CODE)

add_library(kyshutdown SHARED ${CODE})

set_target_properties(kyshutdown PROPERTIES VERSION 3.0.0 SOVERSION 3)

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

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

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

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