summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Bielik <Robert.Bielik@dirac.com>2019-12-26 08:50:10 +0100
committerGarrett D'Amore <garrett@damore.org>2019-12-27 12:39:10 -0800
commita1e169b05e24c30d2936c1b3cad18c7b604e3099 (patch)
tree3142a65b61a63a9d800b8c987125a79f93176081 /src
parent0e11fe4aec20ac85114258c3e21392b479e5119f (diff)
downloadnng-a1e169b05e24c30d2936c1b3cad18c7b604e3099.tar.gz
nng-a1e169b05e24c30d2936c1b3cad18c7b604e3099.tar.bz2
nng-a1e169b05e24c30d2936c1b3cad18c7b604e3099.zip
Add possibility to use mbedtls cmake target if available
Diffstat (limited to 'src')
-rw-r--r--src/supplemental/tls/CMakeLists.txt12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/supplemental/tls/CMakeLists.txt b/src/supplemental/tls/CMakeLists.txt
index 8f819ea8..dfeb6526 100644
--- a/src/supplemental/tls/CMakeLists.txt
+++ b/src/supplemental/tls/CMakeLists.txt
@@ -29,9 +29,15 @@ if (NNG_SUPP_TLS_MBEDTLS)
Consult a lawyer and the license files for details.
************************************************************")
- find_package(mbedTLS REQUIRED)
- set(_LIBS ${MBEDTLS_LIBRARIES})
- set(_INCS ${MBEDTLS_INCLUDE_DIR})
+ # If mbedTLS was added by a consuming project, then we should use that
+ # instance of it, instead of configuring our own.
+ if (TARGET mbedtls)
+ set(_LIBS mbedtls)
+ else()
+ find_package(mbedTLS REQUIRED)
+ set(_LIBS ${MBEDTLS_LIBRARIES})
+ set(_INCS ${MBEDTLS_INCLUDE_DIR})
+ endif()
list(APPEND _SRCS supplemental/tls/mbedtls/tls.c)
else()