diff options
author | Chris Wilson <qris@users.noreply.github.com> | 2018-01-02 21:13:55 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-02 21:13:55 +0000 |
commit | 6d7e9562e8485591a4888f1fc2d3c6c657dc7a01 (patch) | |
tree | 237b161707ed2b45b07a455f0089f23c6ecc1dd3 /infrastructure/cmake/CMakeLists.txt | |
parent | a0fa0c4f5f338335034f172af290025d48d5a1d5 (diff) | |
parent | 85e7efc3fa0477f60318d2cd2144503a9ea8feb9 (diff) |
Merge pull request #22 from boxbackup/openssl_1_1
Fix compatibility with OpenSSL 1.1
Diffstat (limited to 'infrastructure/cmake/CMakeLists.txt')
-rw-r--r-- | infrastructure/cmake/CMakeLists.txt | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/infrastructure/cmake/CMakeLists.txt b/infrastructure/cmake/CMakeLists.txt index 25015452..65f59eb8 100644 --- a/infrastructure/cmake/CMakeLists.txt +++ b/infrastructure/cmake/CMakeLists.txt @@ -407,7 +407,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} crypt32) + 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}) |