dolphin/CMake/FindMBEDTLS.cmake

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
947 B
CMake
Raw Normal View History

2023-05-26 03:59:51 +02:00
find_path(MBEDTLS_INCLUDE_DIR mbedtls/ssl.h PATH_SUFFIXES mbedtls2)
2015-09-26 07:09:19 +02:00
2023-05-26 03:59:51 +02:00
find_library(MBEDTLS_LIBRARY mbedtls PATH_SUFFIXES mbedtls2)
find_library(MBEDX509_LIBRARY mbedx509 PATH_SUFFIXES mbedtls2)
find_library(MBEDCRYPTO_LIBRARY mbedcrypto PATH_SUFFIXES mbedtls2)
2015-09-26 07:09:19 +02:00
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})
set(CMAKE_REQUIRED_INCLUDES ${MBEDTLS_INCLUDE_DIRS})
check_cxx_source_compiles("
#include <mbedtls/version.h>
2022-04-03 01:30:22 +02:00
#if MBEDTLS_VERSION_NUMBER < 0x021C0000
2015-09-26 07:09:19 +02:00
#error \"Your mbed TLS version is too old.\"
#endif
int main() {}"
MBEDTLS_VERSION_OK)
unset(CMAKE_REQUIRED_INCLUDES)
2015-09-26 07:09:19 +02:00
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MBEDTLS DEFAULT_MSG
MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY MBEDTLS_VERSION_OK)
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)