--- CMakeLists.txt.orig 2023-08-28 10:32:04 UTC +++ CMakeLists.txt @@ -14,9 +14,12 @@ check_c_compiler_flag("-mno-unaligned-access" CC_HAS_M include(CheckCCompilerFlag) check_c_compiler_flag("-mno-unaligned-access" CC_HAS_MNO_UNALIGNED_ACCESS) -add_library(msgpuck STATIC msgpuck.c hints.c) -set_target_properties(msgpuck PROPERTIES VERSION 1.0 SOVERSION 1) -set_target_properties(msgpuck PROPERTIES OUTPUT_NAME "msgpuck") +add_library(msgpuck_shared SHARED msgpuck.c hints.c) +set_target_properties(msgpuck_shared PROPERTIES VERSION 1.0 SOVERSION 1) +set_target_properties(msgpuck_shared PROPERTIES OUTPUT_NAME "msgpuck") +add_library(msgpuck_static STATIC msgpuck.c hints.c) +set_target_properties(msgpuck_static PROPERTIES VERSION 1.0 SOVERSION 1) +set_target_properties(msgpuck_static PROPERTIES OUTPUT_NAME "msgpuck") if (NOT ${PROJECT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR}) # Embedded mode, skip tests, documentation and the install targets @@ -34,7 +37,11 @@ include(GNUInstallDirs) add_subdirectory(test) include(GNUInstallDirs) -install(TARGETS msgpuck +install(TARGETS msgpuck_shared + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT library) +install(TARGETS msgpuck_static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT library)