--- src/CMakeLists.txt.orig 2026-04-06 22:57:56 UTC +++ src/CMakeLists.txt @@ -29,6 +29,7 @@ add_library(cbor ${SOURCES}) endif() add_library(cbor ${SOURCES}) +add_library(cbor_static STATIC ${SOURCES}) target_compile_definitions(cbor PRIVATE @@ -60,7 +61,13 @@ target_include_directories(cbor PUBLIC $ $ $) +target_include_directories(cbor_static PUBLIC + $ + $ + $ + $) set_target_properties(cbor PROPERTIES EXPORT_NAME libcbor) +set_target_properties(cbor_static PROPERTIES OUTPUT_NAME cbor) # For vendored builds add_library(libcbor::libcbor ALIAS cbor) @@ -88,7 +95,7 @@ set_target_properties( PROPERTIES VERSION ${PROJECT_VERSION} MACHO_COMPATIBILITY_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.0 - SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}) + SOVERSION ${PROJECT_VERSION_MAJOR}) join_paths(libdir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_LIBDIR}") join_paths(includedir_for_pc_file "\${prefix}" "${CMAKE_INSTALL_INCLUDEDIR}") @@ -96,7 +103,7 @@ install( # http://www.cmake.org/Wiki/CMake:Install_Commands install( - TARGETS cbor + TARGETS cbor cbor_static EXPORT libcborTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}