summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2020-12-10 12:16:01 +0100
committerPetr Štetiar <ynezz@true.cz>2020-12-10 12:18:05 +0100
commitfa8ecd6ed14036256e43cfe8ebaf52770e6e0826 (patch)
tree16c7b17b24ead619cee6227139bb6076da7c645f
parent63656f81045f35e96eb15668b43fba26de27b472 (diff)
downloadustream-ssl-fa8ecd6ed14036256e43cfe8ebaf52770e6e0826.tar.gz
cmake: fix linking when mbed TLS not in default paths
Fixes following issue when mbed TLS libs are installed in different paths: /usr/bin/ld: cannot find -lmbedtls /usr/bin/ld: cannot find -lmbedcrypto /usr/bin/ld: cannot find -lmbedx509 Signed-off-by: Petr Štetiar <ynezz@true.cz>
-rw-r--r--CMakeLists.txt5
1 files changed, 4 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 42c7f1f..bb2abe5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,7 +10,10 @@ SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
IF(MBEDTLS)
ADD_DEFINITIONS(-DHAVE_MBEDTLS)
SET(SSL_SRC ustream-mbedtls.c)
- SET(SSL_LIB mbedtls mbedcrypto mbedx509 m)
+ FIND_LIBRARY(mbedtls_library mbedtls)
+ FIND_LIBRARY(mbedx509_library mbedx509)
+ FIND_LIBRARY(mbedcrypto_library mbedcrypto)
+ SET(SSL_LIB ${mbedtls_library} ${mbedx509_library} ${mbedcrypto_library} m)
ELSEIF(WOLFSSL)
ADD_DEFINITIONS(-DHAVE_WOLFSSL)
FIND_LIBRARY(wolfssl_library wolfssl)