aux_source_directory(. SOURCESCODE)
include_directories(.)
add_library(kyglobal SHARED ${SOURCESCODE})
set_target_properties(kyglobal PROPERTIES VERSION 3.0.0 SOVERSION 3)
add_executable(kyglobal-test test/kyglobal-test.c)

find_library(DBUS_LIB dbus-1)
find_library(GLIBC_LIB glib-2.0)

target_link_libraries(kyglobal kylocation kylog cjson ${DBUS_LIB} ${DBUS_GLIB_LIB})
target_link_libraries(kyglobal-test kyglobal kysysinfo)
target_link_options(kyglobal PRIVATE "-Wl,-z,now")

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

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

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