From 53162e42b2fc866938e2a0c849b68d0f261f830a Mon Sep 17 00:00:00 2001 From: Ayoub Zaki Date: Thu, 6 Feb 2025 17:27:13 +0100 Subject: [PATCH] cmake: fix package LIBKCAPI option --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68a7ce7..e50ff97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,8 +29,15 @@ endif() option(USE_KERNEL_CRYPTO_API "Use the kernel crypto API to perform the hashing") if(USE_KERNEL_CRYPTO_API) - list(APPEND CRYPTO_LIBRARIES kcapi) - add_compile_definitions(USE_KERNEL_CRYPTO_API) + pkg_check_modules(LIBKCAPI REQUIRED libkcapi) + if (LIBKCAPI_FOUND) + include_directories(${LIBKCAPI_INCLUDE_DIRS}) + link_directories(${LIBKCAPI_LIBRARY_DIRS}) + list(APPEND CRYPTO_LIBRARIES ${LIBKCAPI_LIBRARIES}) + add_compile_definitions(USE_KERNEL_CRYPTO_API) + else() + message(FATAL_ERROR "libkcapi not found") + endif() endif() if (NOT DEFINED DEFAULT_READ_BLK_SIZE)