Skip to content

Commit

Permalink
Workaround for incorrect library suffixes searched by FindOpenSSL
Browse files Browse the repository at this point in the history
  • Loading branch information
qris committed Jan 1, 2018
1 parent 4e24006 commit 448ac48
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion infrastructure/cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,26 @@ else()
endif()

# Link to OpenSSL
find_package(OpenSSL REQUIRED)
# Workaround for incorrect library suffixes searched by FindOpenSSL:
# https://gitlab.kitware.com/cmake/cmake/issues/17604
if(WIN32 AND MSVC)
find_package(OpenSSL)
set(OPENSSL_SSL_LIBRARY ${SSL_EAY_RELEASE})
set(OPENSSL_CRYPTO_LIBRARY ${LIB_EAY_RELEASE})
set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
find_package_handle_standard_args(OpenSSL
REQUIRED_VARS
OPENSSL_SSL_LIBRARY
OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR
VERSION_VAR
OPENSSL_VERSION
FAIL_MESSAGE
"Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR"
)
else()
find_package(OpenSSL REQUIRED)
endif()
include_directories(${OPENSSL_INCLUDE_DIR})
target_link_libraries(lib_crypto PUBLIC ${OPENSSL_LIBRARIES})

Expand Down

0 comments on commit 448ac48

Please sign in to comment.