Skip to content

Commit

Permalink
Adding camke search for MbedTLS
Browse files Browse the repository at this point in the history
  • Loading branch information
huitema committed Nov 4, 2023
1 parent 08f121e commit 741b013
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ if(BUILD_TESTING AND picoquic_BUILD_TESTS)
set_picoquic_compile_settings(picoquic-test)

add_executable(picoquic_ct picoquic_t/picoquic_t.c)
target_link_libraries(picoquic_ct PRIVATE picoquic-test)
target_link_libraries(picoquic_ct PRIVATE picoquic-test ${MBEDTLS_LIBRARIES})
set_picoquic_compile_settings(picoquic_ct)

add_executable(picohttp_ct
Expand Down
20 changes: 20 additions & 0 deletions cmake/FindMbedTLS.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# - Try to find MbedTLS
# set(MBEDTLS_LIBRARY mbedtls)
# set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_SOURCE_DIR}/include)
find_path(MBEDTLS_INCLUDE_DIRS
NAMES mbedtls/build_info.h psa/crypto.h
HINTS ${MBEDTLS_PREFIX}/include/
${CMAKE_SOURCE_DIR}/../mbedtls/include/
${CMAKE_BINARY_DIR}/../mbedtls/include/
../mbedtls/include/ )

set(MBEDTLS_HINTS ${MBEDTLS_PREFIX}/build/library
${CMAKE_BINARY_DIR}/../mbedtls/build/library
../mbedtls/build/library ../mbedtls/library)

find_library(MBEDTLS_LIBRARY mbedtls HINTS ${MBEDTLS_HINTS})
find_library(MBEDTLS_CRYPTO mbedcrypto HINTS ${MBEDTLS_HINTS})
find_library(MBEDTLS_X509 mbedx509 HINTS ${MBEDTLS_HINTS})
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDTLS_CRYPTO} ${MBEDTLS_X509})

mark_as_advanced(MBEDTLS_LIBRARY MBEDTLS_INCLUDE_DIRS)

0 comments on commit 741b013

Please sign in to comment.