Skip to content

Commit

Permalink
fixes #1771 cmake: respect CMAKE_FIND_PACKAGE_PREFER_CONFIG if present
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Feb 29, 2024
1 parent df20afb commit ec9dae9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/supplemental/tls/mbedtls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ if (NNG_TLS_ENGINE STREQUAL "mbed")
else()
# We want to prefer config mode over our local find package.
# mbedTLS v3 has a config file, which should work better than
# what we do here. We do restore the setting though because
# user applications might not expect this.
if (NOT CMAKE_FIND_PACKAGE_PREFER_CONFIG)
# what we do here. We only make this override locally, to
# avoid confounding any other package consumers, and we honor overrides.
if (NOT (DEFINED CMAKE_FIND_PACKAGE_PREFER_CONFIG))
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
find_package(MbedTLS REQUIRED)
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG FALSE)
unset(CMAKE_FIND_PACKAGE_PREFER_CONFIG)
else()
find_package(MbedTLS REQUIRED)
endif()
Expand Down

0 comments on commit ec9dae9

Please sign in to comment.