aux_source_directory(. CODE)

add_library(kyrealtime SHARED ${CODE})

set_target_properties(kyrealtime PROPERTIES VERSION 3.0.0 SOVERSION 3)

find_library(DBUS_LIB dbus-1)
add_executable(kyrealtime-test test/kyrealtime-test.c)
target_link_libraries(kyrealtime ${DBUS_LIB} kylog)
target_link_libraries(kyrealtime-test kyrealtime)
target_link_options(kyrealtime PRIVATE "-Wl,-z,now")

add_executable(realtimeinfo-test test/realtimeinfo-test.cpp)
target_link_libraries(realtimeinfo-test kyrealtime)

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

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

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