diff --git a/CMakeLists.txt b/CMakeLists.txt index 59ad1aa0..95c8bc56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -356,9 +356,13 @@ if(${OPENSSL}) set(OPENSSL_LINK_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) else() message(STATUS "Searching for custom OpenSSL library") - - find_library(OpenSSL REQUIRED NAMES ssl PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH) - find_library(Crypto REQUIRED NAMES crypto PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH) + if(WIN32 OR WIN64 OR MSVC) + find_library(OpenSSL REQUIRED NAMES libssl PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH) + find_library(Crypto REQUIRED NAMES libcrypto PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH) + else() + find_library(OpenSSL REQUIRED NAMES ssl PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH) + find_library(Crypto REQUIRED NAMES crypto PATHS ${OPENSSL_ROOT_DIR}/${CUSTOM_OPENSSL_LIB_DIR} NO_DEFAULT_PATH) + endif() message(STATUS "Used libraries:") message(STATUS "-> ${OpenSSL}")