summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorمهدي شينون (Mehdi Chinoune) <mehdi.chinoune@hotmail.com>2023-04-05 04:46:13 -0400
committerBrad King <brad.king@kitware.com>2023-04-05 09:49:31 -0400
commit248689f9bf6787fce8596ddfbd9f0e3119999ee9 (patch)
tree4f62fb11f2a950057c644346a8254061a1a8f1fd
parenteb2bdbd3013f482c4db5c599c1c528ad0e7eb92d (diff)
downloadcmake-248689f9bf6787fce8596ddfbd9f0e3119999ee9.tar.gz
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.
-rw-r--r--Modules/FindOpenSSL.cmake4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index 4e8374c68e..45dc9ac809 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}