--- CMakeLists.txt.orig 2024-06-10 09:34:37 UTC +++ CMakeLists.txt @@ -13,8 +13,9 @@ file(GLOB HEADER_FILES "src/include/*.h") file(GLOB SOURCE_FILES "src/aegis128l/*.c" "src/aegis128x2/*.c" "src/aegis128x4/*.c" "src/aegis256/*.c" "src/aegis256x2/*.c" "src/aegis256x4/*.c" "src/common/*.c") file(GLOB HEADER_FILES "src/include/*.h") -add_library("${PROJECT_NAME}") +add_library("${PROJECT_NAME}" SHARED) add_library("${PROJECT_NAME}::${PROJECT_NAME}" ALIAS "${PROJECT_NAME}") +add_library("${PROJECT_NAME}_static" STATIC) target_sources("${PROJECT_NAME}" PRIVATE ${SOURCE_FILES}) @@ -22,11 +23,19 @@ target_include_directories("${PROJECT_NAME}" PUBLIC $ $) +target_sources("${PROJECT_NAME}_static" PRIVATE ${SOURCE_FILES}) + +target_include_directories("${PROJECT_NAME}_static" + PUBLIC $ + $) + +set_target_properties("${PROJECT_NAME}_static" PROPERTIES OUTPUT_NAME "${PROJECT_NAME}") + # Installation set(TARGETS_EXPORT_NAME "${PROJECT_NAME}-targets") -install(TARGETS "${PROJECT_NAME}" +install(TARGETS "${PROJECT_NAME}" "${PROJECT_NAME}_static" EXPORT "${TARGETS_EXPORT_NAME}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")