aux_source_directory(. SOURCESCODE)
include_directories(.)
add_library(kypackage SHARED ${SOURCESCODE})
set_target_properties(kypackage PROPERTIES VERSION 3.0.0 SOVERSION 3)
find_library(DBUS_LIB dbus-1)
find_library(GLIBC_LIB glib-2.0)

pkg_check_modules(KYSDKCONF2 kysdk-conf2)
target_include_directories(kypackage PRIVATE ${KYSDKCONF2_INCLUDE_DIRS})
target_link_directories(kypackage PRIVATE ${KYSDKCONF2_LIBRARY_DIRS})
target_link_libraries(kypackage libcjson.so kylog ${DBUS_LIB} ${KYSDKCONF2_LIBRARIES} ${DBUS_GLIB_LIB})
add_executable(kypackage-test test/kypackage-test.c)
target_link_libraries(kypackage-test kypackage)
target_link_options(kypackage PRIVATE "-Wl,-z,now")

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

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

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