Merge pull request #376 from Homqyy/master

同时生成动态库和静态库,安装的时候安装的是动态库
This commit is contained in:
Linwei 2022-11-16 17:52:22 +08:00 committed by GitHub
commit fe306fc4ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,10 +6,13 @@ include(CTest)
include(GNUInstallDirs)
add_library(kcp STATIC ikcp.c)
add_library(kcp_shared SHARED ikcp.c)
set_property(TARGET kcp_shared PROPERTY LIBRARY_OUTPUT_NAME kcp)
install(FILES ikcp.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(TARGETS kcp
install(TARGETS kcp_shared
EXPORT kcp-targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}