Skip to content

Commit

Permalink
cmake UPDATE rename mbedtls include dir var
Browse files Browse the repository at this point in the history
  • Loading branch information
roman committed May 14, 2024
1 parent 2b9ce8c commit f99eb74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ if(ENABLE_SSH_TLS)
# dependencies - mbedtls
set(HAVE_MBEDTLS TRUE)
list(APPEND libsrc src/session_mbedtls.c)
include_directories(${MBEDTLS_INCLUDE_DIR})
include_directories(${MBEDTLS_INCLUDE_DIRS})
target_link_libraries(netconf2 ${MBEDTLS_LIBRARIES})
list(APPEND CMAKE_REQUIRED_LIBRARIES ${MBEDTLS_LIBRARIES})
else()
Expand Down
10 changes: 5 additions & 5 deletions CMakeModules/FindMbedTLS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Once done this will define
#
# MBEDTLS_FOUND - MbedTLS was found
# MBEDTLS_INCLUDE_DIR - MbedTLS include directories
# MBEDTLS_INCLUDE_DIRS - MbedTLS include directories
# MBEDTLS_LIBRARIES - link these to use MbedTLS
# MBEDTLS_VERSION - version of MbedTLS
#
Expand Down Expand Up @@ -34,7 +34,7 @@
#
include(FindPackageHandleStandardArgs)

if(MBEDTLS_LIBRARIES AND MBEDTLS_INCLUDE_DIR)
if(MBEDTLS_LIBRARIES AND MBEDTLS_INCLUDE_DIRS)
# in cache already
set(MBEDTLS_FOUND TRUE)
else()
Expand Down Expand Up @@ -98,13 +98,13 @@ else()
endif()
endif()

set(MBEDTLS_INCLUDE_DIR ${MBEDTLS_INCLUDE_DIR})
set(MBEDTLS_INCLUDE_DIRS ${MBEDTLS_INCLUDE_DIR})
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY})

find_package_handle_standard_args(MbedTLS FOUND_VAR MBEDTLS_FOUND
REQUIRED_VARS MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARIES
REQUIRED_VARS MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARIES
VERSION_VAR MBEDTLS_VERSION)

# show the MBEDTLS_INCLUDE_DIR and MBEDTLS_LIBRARIES variables only in the advanced view
mark_as_advanced(MBEDTLS_INCLUDE_DIR MBEDTLS_LIBRARIES)
mark_as_advanced(MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARIES)
endif()

0 comments on commit f99eb74

Please sign in to comment.