From 248689f9bf6787fce8596ddfbd9f0e3119999ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D9=85=D9=87=D8=AF=D9=8A=20=D8=B4=D9=8A=D9=86=D9=88=D9=86?= =?UTF-8?q?=20=28Mehdi=20Chinoune=29?= Date: Wed, 5 Apr 2023 04:46:13 -0400 Subject: FindOpenSSL: Fix finding header files and static libraries on MinGW * Avoid searching in the `Program Files` folder because the official OpenSSL is built for the MSVC ABI, and so is not compatible with MinGW. * Static libraries on MinGW has `.a` extension. --- Modules/FindOpenSSL.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake index 4e8374c..45dc9ac 100644 --- a/Modules/FindOpenSSL.cmake +++ b/Modules/FindOpenSSL.cmake @@ -210,7 +210,7 @@ endif () # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES if(OPENSSL_USE_STATIC_LIBS) set(_openssl_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) - if(WIN32) + if(MSVC) set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) else() set(CMAKE_FIND_LIBRARY_SUFFIXES .a ) @@ -230,7 +230,7 @@ else() set(_OPENSSL_FIND_PATH_SUFFIX "include") endif() -if (WIN32) +if (MSVC) # http://www.slproweb.com/products/Win32OpenSSL.html set(_OPENSSL_ROOT_HINTS ${OPENSSL_ROOT_DIR} -- cgit v0.12