aux_source_directory(linklist/skip_linklist SOURCESCODESTRUCT)
add_library(kydatastruct SHARED ${SOURCESCODESTRUCT})
set_target_properties(kydatastruct PROPERTIES VERSION 3.0.1 SOVERSION 1)
target_compile_options(kydatastruct PRIVATE "-fstack-protector-all")
target_link_options(kydatastruct PRIVATE "-Wl,-z,now")

include_directories(linklist)
include_directories(linklist/skip_linklist)

add_executable(test-delete linklist/skip_linklist/test/delete_test.c)
add_executable(test-insert linklist/skip_linklist/test/insert_test.c)
add_executable(test-search linklist/skip_linklist/test/search_test.c)
target_link_libraries(test-delete kydatastruct)
target_link_libraries(test-insert kydatastruct)
target_link_libraries(test-search kydatastruct)

# 安装库文件  
install(TARGETS kydatastruct 
        DESTINATION ${CMAKE_INSTALL_LIBDIR})

install(FILES
        linklist/listdata.h
        linklist/skip_linklist/skip_linklist.h
        DESTINATION ${CMAKE_INSTALL_HEADER_DIR})
