diff options
| author | Robert Bielik <Robert.Bielik@dirac.com> | 2019-12-26 08:50:10 +0100 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2019-12-27 12:39:10 -0800 |
| commit | a1e169b05e24c30d2936c1b3cad18c7b604e3099 (patch) | |
| tree | 3142a65b61a63a9d800b8c987125a79f93176081 | |
| parent | 0e11fe4aec20ac85114258c3e21392b479e5119f (diff) | |
| download | nng-a1e169b05e24c30d2936c1b3cad18c7b604e3099.tar.gz nng-a1e169b05e24c30d2936c1b3cad18c7b604e3099.tar.bz2 nng-a1e169b05e24c30d2936c1b3cad18c7b604e3099.zip | |
Add possibility to use mbedtls cmake target if available
| -rw-r--r-- | src/supplemental/tls/CMakeLists.txt | 12 |
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() |
