同时生成动态库和静态库,安装的时候安装的是动态库

This commit is contained in:
wang_hongqi 2022-11-16 08:16:00 +00:00
parent f553df7afc
commit d06a81a28a

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}