summaryrefslogtreecommitdiffstats
path: root/cmake/FindMbedTLS.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/FindMbedTLS.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/FindMbedTLS.cmake')
-rw-r--r--cmake/FindMbedTLS.cmake38
1 files changed, 38 insertions, 0 deletions
diff --git a/cmake/FindMbedTLS.cmake b/cmake/FindMbedTLS.cmake
new file mode 100644
index 0000000..ceb6cfb
--- /dev/null
+++ b/cmake/FindMbedTLS.cmake
@@ -0,0 +1,38 @@
+
+find_path(MBEDTLS_INCLUDE_DIR
+ NAMES mbedtls/ssl.h
+ PATH_SUFFIXES include
+ HINTS ${MBEDTLS_ROOT})
+
+find_library(MBEDTLS_LIBRARY
+ NAMES mbedtls
+ PATH_SUFFIXES lib
+ HINTS ${MBEDTLS_ROOT})
+
+find_library(MBEDCRYPTO_LIBRARY
+ NAMES mbedcrypto
+ PATH_SUFFIXES lib
+ HINTS ${MBEDTLS_ROOT})
+
+find_library(MBEDX509_LIBRARY
+ NAMES mbedx509
+ PATH_SUFFIXES lib
+ HINTS ${MBEDTLS_ROOT})
+
+if(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY)
+ set(MBEDTLS_FOUND TRUE)
+ set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDCRYPTO_LIBRARY} ${MBEDX509_LIBRARY})
+endif()
+
+if(MBEDTLS_FOUND)
+ if(NOT MBEDTLS_FIND_QUIETLY)
+ message(STATUS "Found mbed TLS: ${MBEDTLS_LIBRARIES}")
+ endif()
+else()
+ if(MBEDTLS_FIND_REQUIRED)
+ message(FATAL_ERROR "mbed TLS was not found")
+ endif()
+endif()
+
+mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY)
+