aux_source_directory(. SOURCESCODE)
include_directories(.)
include_directories(/usr/include/cjson/)
find_library(GLIBC_LIB glib-2.0)
find_library(DBUS_LIB dbus-1)
find_library(DBUS_GLIB_LIB dbus-glib-1)
find_package(PkgConfig)
add_library(kysysinfo SHARED libkysysinfo.c)
set_target_properties(kysysinfo PROPERTIES VERSION 3.0.0 SOVERSION 3)
add_executable(kysysinfo-test test/kysysinfo_test.c)
target_link_libraries(kysysinfo dl kylog systemd kyconf X11 Xrandr libcjson.so pci kmod kypackage ${GLIBC_LIB} ${DBUS_LIB} ${DBUS_GLIB_LIB})
target_link_libraries(kysysinfo-test kysysinfo libcjson.so)
# target_link_libraries(kysysinfo-test kysysinfo kylin-activation kylog systemd kyconf ${GLIBC_LIB} ${DBUS_LIB} ${DBUS_GLIB_LIB})
target_link_options(kysysinfo PRIVATE "-Wl,-z,now")

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

# 安装库文件  
install(TARGETS kysysinfo
        DESTINATION ${CMAKE_INSTALL_LIBDIR})
# install(TARGETS kysysinfo
#         DESTINATION lib/kysdk/kysdk-system)
        
install(FILES libkysysinfo.hpp
        DESTINATION include/kysdk/kysdk-system)

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