diff --git a/cmake/modules/CompilerOptions.cmake b/cmake/modules/CompilerOptions.cmake index 236f3d29..151166d3 100644 --- a/cmake/modules/CompilerOptions.cmake +++ b/cmake/modules/CompilerOptions.cmake @@ -296,6 +296,21 @@ elseif(WITH_CRYPTO_BACKEND STREQUAL "openssl") message(STATUS "OpenSSL: Includes: ${CRYPTO_INCLUDES}") message(STATUS "OpenSSL: Libs: ${CRYPTO_LIBS}") + if(WIN32) + set(_ossl_inc "${OPENSSL_INCLUDE_DIR}") + if(_ossl_inc) + if(_ossl_inc MATCHES ";") + list(GET OPENSSL_INCLUDE_DIR 0 _ossl_inc) + endif() + get_filename_component(_triplet_root "${_ossl_inc}" DIRECTORY) + set(_vcpkg_bin "${_triplet_root}/bin") + if(EXISTS "${_vcpkg_bin}") + message(STATUS "Extending PATH with ${_vcpkg_bin} for OpenSSL ECC tests") + set(ENV{PATH} "${_vcpkg_bin};$ENV{PATH}") + endif() + endif() + endif() + check_include_files(openssl/ssl.h HAVE_OPENSSL_SSL_H) get_filename_component(CRYPTO_LIB_DIR "${OPENSSL_CRYPTO_LIBRARY}" DIRECTORY) check_library_exists(crypto "BN_new" "${CRYPTO_LIB_DIR}" HAVE_LIBCRYPTO)