# 设置库的根目录
set(HCNet_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR} CACHE PATH "HCNetSDK 根目录")

# 设置头文件目录
set(HCNet_INCLUDE_DIRS ${HCNet_ROOT_DIR}/include)

# 创建导入目标
add_library(HCNet::HCNetSDK SHARED IMPORTED)
set_target_properties(HCNet::HCNetSDK PROPERTIES
        IMPORTED_LOCATION ${HCNet_ROOT_DIR}/bin/HCNetSDK.dll
        IMPORTED_LOCATION_DEBUG ${HCNet_ROOT_DIR}/bin/HCNetSDK.dll
        IMPORTED_IMPLIB ${HCNet_ROOT_DIR}/bin/HCNetSDK.lib
        IMPORTED_IMPLIB_DEBUG ${HCNet_ROOT_DIR}/bin/HCNetSDK.lib
        INTERFACE_INCLUDE_DIRECTORIES ${HCNet_INCLUDE_DIRS}
)
add_library(HCNet::HCCore SHARED IMPORTED)
set_target_properties(HCNet::HCCore PROPERTIES
        IMPORTED_LOCATION ${HCNet_ROOT_DIR}/bin/HCCore.dll
        IMPORTED_LOCATION_DEBUG ${HCNet_ROOT_DIR}/bin/HCCore.dll
        IMPORTED_IMPLIB ${HCNet_ROOT_DIR}/bin/HCCore.lib
        IMPORTED_IMPLIB_DEBUG ${HCNet_ROOT_DIR}/bin/HCCore.lib
        INTERFACE_INCLUDE_DIRECTORIES ${HCNet_INCLUDE_DIRS}
)

file(COPY ${HCNet_ROOT_DIR}/bin/ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)

set(HCNet_FOUND TRUE)
