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)