From 4fa4ab1fa470274585f8c1b8fda4b1456d474438 Mon Sep 17 00:00:00 2001 From: fwh-dc <56966127+fwh-dc@users.noreply.github.com> Date: Sat, 24 Aug 2024 06:50:09 +0200 Subject: [PATCH] Force liboqs as a debian package dependency requirement only if it is not a static linked library. (#493) Signed-off-by: Frederik Wedel-Heinen --- CMakeLists.txt | 3 ++- oqsprov/CMakeLists.txt | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 297f5c50..46967512 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,8 @@ endif() # Add required include for liboqs find_package(liboqs REQUIRED) get_target_property(LIBOQS_INCLUDE_DIR OQS::oqs INTERFACE_INCLUDE_DIRECTORIES) -message(STATUS "liboqs found: Include dir at ${LIBOQS_INCLUDE_DIR}") +get_target_property(LIBOQS_LIBRARY_TYPE OQS::oqs TYPE) +message(STATUS "liboqs found: Include dir at ${LIBOQS_INCLUDE_DIR} (${LIBOQS_LIBRARY_TYPE})") include_directories(${LIBOQS_INCLUDE_DIR}) # Hints the compiler on the fact that the provider is being compiled into a static library. diff --git a/oqsprov/CMakeLists.txt b/oqsprov/CMakeLists.txt index 6b5afe3b..2b9730d0 100644 --- a/oqsprov/CMakeLists.txt +++ b/oqsprov/CMakeLists.txt @@ -94,7 +94,11 @@ install(TARGETS oqsprovider set(CPACK_GENERATOR "DEB") set(CPACK_PACKAGE_VENDOR "www.openquantumsafe.org") set(CPACK_PACKAGE_VERSION ${OQSPROVIDER_VERSION_TEXT}) -set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, openssl (>= 3.0.0), liboqs (>= 0.8.0)") +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6, openssl (>= 3.0.0)") +if (NOT "${LIBOQS_LIBRARY_TYPE}" STREQUAL "STATIC_LIBRARY") + message("Adding liboqs as dynamic dependency for the debian package") + string(APPEND CPACK_DEBIAN_PACKAGE_DEPENDS ", liboqs (>= 0.8.0)") +endif () set(CPACK_DEBIAN_PACKAGE_MAINTAINER "www.openquantumsafe.org") include(CPack)