diff -Naur a/plugins/qca-gcrypt/CMakeLists.txt b/plugins/qca-gcrypt/CMakeLists.txt
--- a/plugins/qca-gcrypt/CMakeLists.txt	2024-06-24 16:53:42.000000000 +0600
+++ b/plugins/qca-gcrypt/CMakeLists.txt	2024-06-28 15:06:44.402978564 +0600
@@ -1,9 +1,8 @@
-find_package(PkgConfig REQUIRED)
 
 if(WITH_gcrypt_PLUGIN STREQUAL "yes")
-  pkg_check_modules(LIBGCRYPT REQUIRED IMPORTED_TARGET libgcrypt)
+  find_package(LibGcrypt REQUIRED)
 else()
-  pkg_check_modules(LIBGCRYPT IMPORTED_TARGET libgcrypt)
+  find_package(LibGcrypt)
 endif()
 
 if(LIBGCRYPT_FOUND)

diff --git a/cmake/modules/FindLibGcrypt.cmake b/cmake/modules/FindLibGcrypt.cmake
--- /dev/null
+++ a/cmake/modules/FindLibGcrypt.cmake
@@ -0,0 +0,51 @@
+# - Try to find the Gcrypt library
+# Once run this will define
+#
+#  LIBGCRYPT_FOUND - set if the system has the gcrypt library
+#  LIBGCRYPT_CFLAGS - the required gcrypt compilation flags
+#  LIBGCRYPT_LIBRARIES - the linker libraries needed to use the gcrypt library
+#
+# Copyright (c) 2006 Brad Hards <bradh@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+# libgcrypt is moving to pkg-config, but earlier version don't have it
+
+#search in typical paths for libgcrypt-config
+FIND_PROGRAM(LIBGCRYPTCONFIG_EXECUTABLE NAMES libgcrypt-config)
+mark_as_advanced(LIBGCRYPTCONFIG_EXECUTABLE)
+
+#reset variables
+set(LIBGCRYPT_LIBRARIES)
+set(LIBGCRYPT_CFLAGS)
+
+# if libgcrypt-config has been found
+IF(LIBGCRYPTCONFIG_EXECUTABLE)
+
+# workaround for MinGW/MSYS
+  # CMake can't starts shell scripts on windows so it need to use sh.exe
+  EXECUTE_PROCESS(COMMAND sh ${LIBGCRYPTCONFIG_EXECUTABLE} --libs RESULT_VARIABLE _return_VALUE OUTPUT_VARIABLE LIBGCRYPT_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
+  EXECUTE_PROCESS(COMMAND sh ${LIBGCRYPTCONFIG_EXECUTABLE} --cflags RESULT_VARIABLE _return_VALUE OUTPUT_VARIABLE LIBGCRYPT_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+  IF(NOT LIBGCRYPT_CFLAGS AND NOT _return_VALUE)
+    SET(LIBGCRYPT_CFLAGS " ")
+  ENDIF(NOT LIBGCRYPT_CFLAGS AND NOT _return_VALUE)
+
+  IF(LIBGCRYPT_LIBRARIES AND LIBGCRYPT_CFLAGS)
+    SET(LIBGCRYPT_FOUND TRUE)
+  ENDIF(LIBGCRYPT_LIBRARIES AND LIBGCRYPT_CFLAGS)
+
+ENDIF(LIBGCRYPTCONFIG_EXECUTABLE)
+
+if (LIBGCRYPT_FOUND)
+   if (NOT LibGcrypt_FIND_QUIETLY)
+      message(STATUS "Found libgcrypt: ${LIBGCRYPT_LIBRARIES}")
+   endif()
+else()
+if (LibGcrypt_FIND_REQUIRED)
+      message(FATAL_ERROR "Could not find libgcrypt libraries")
+   endif()
+endif()
+
+MARK_AS_ADVANCED(LIBGCRYPT_CFLAGS LIBGCRYPT_LIBRARIES)
+
