summaryrefslogtreecommitdiffstats
path: root/cmake/FindPkcs11.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:24:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:24:41 +0000
commita9bcc81f821d7c66f623779fa5147e728eb3c388 (patch)
tree98676963bcdd537ae5908a067a8eb110b93486a6 /cmake/FindPkcs11.cmake
parentInitial commit. (diff)
downloadfreerdp3-a9bcc81f821d7c66f623779fa5147e728eb3c388.tar.xz
freerdp3-a9bcc81f821d7c66f623779fa5147e728eb3c388.zip
Adding upstream version 3.3.0+dfsg1.upstream/3.3.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/FindPkcs11.cmake')
-rw-r--r--cmake/FindPkcs11.cmake29
1 files changed, 29 insertions, 0 deletions
diff --git a/cmake/FindPkcs11.cmake b/cmake/FindPkcs11.cmake
new file mode 100644
index 0000000..bcfb206
--- /dev/null
+++ b/cmake/FindPkcs11.cmake
@@ -0,0 +1,29 @@
+# - Try to find Pkcs11-helper
+# Using Pkg-config if available for path
+#
+# PKCS11_FOUND - all required ffmpeg components found on system
+# PKCS11_INCLUDE_DIRS - combined include directories
+# PKCS11_LIBRARIES - combined libraries to link
+
+find_package(PkgConfig)
+
+if (PKG_CONFIG_FOUND)
+ pkg_check_modules(PKCS11 libpkcs11-helper-1)
+endif()
+
+find_path(PKCS11_INCLUDE_DIR pkcs11-helper-1.0/pkcs11.h PATHS ${PKCS11_INCLUDE_DIRS})
+find_library(PKCS11_LIBRARY pkcs11-helper PATHS ${PKCS11_LIBRARY_DIRS})
+
+if (PKCS11_INCLUDE_DIR AND PKCS11_LIBRARY)
+ set(PKCS11_FOUND TRUE)
+endif()
+
+set(Pkcs11_FOUND ${PKCS11_FOUND})
+set(Pkcs11_INCLUDE_DIR ${PKCS11_INCLUDE_DIR})
+set(Pkcs11_INCLUDE_DIRS ${PKCS11_INCLUDE_DIR})
+set(Pkcs11_LIBRARY ${PKCS11_LIBRARY})
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Pkcs11 DEFAULT_MSG Pkcs11_FOUND)
+
+