aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2018-02-06 12:54:46 -0500
committerGravatar GitHub <noreply@github.com>2018-02-06 12:54:46 -0500
commit4493cea016abae37174a3b51e8e9b51aad4f65a4 (patch)
treec53c9681a54ece02c6bcda3f4f14f1edf8fb138a /cmake
parent007f1197ac6376cd6a77dca141966ba3aceec9aa (diff)
parent5e9cfd9a99df31febf31f4aa1d0da9efa1e83e32 (diff)
Merge pull request #14019 from hacst/cmake-export-fix
Fix cmake export for grpc
Diffstat (limited to 'cmake')
-rw-r--r--cmake/ssl.cmake8
-rw-r--r--cmake/zlib.cmake7
2 files changed, 13 insertions, 2 deletions
diff --git a/cmake/ssl.cmake b/cmake/ssl.cmake
index 75ce069fe6..53d8a1597e 100644
--- a/cmake/ssl.cmake
+++ b/cmake/ssl.cmake
@@ -32,7 +32,13 @@ if("${gRPC_SSL_PROVIDER}" STREQUAL "module")
endif()
elseif("${gRPC_SSL_PROVIDER}" STREQUAL "package")
find_package(OpenSSL REQUIRED)
- set(_gRPC_SSL_LIBRARIES ${OPENSSL_LIBRARIES})
+
+ if(TARGET OpenSSL::SSL)
+ set(_gRPC_SSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto)
+ else()
+ set(_gRPC_SSL_LIBRARIES ${OPENSSL_LIBRARIES})
+ endif()
set(_gRPC_SSL_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR})
+
set(_gRPC_FIND_SSL "if(NOT OPENSSL_FOUND)\n find_package(OpenSSL)\nendif()")
endif()
diff --git a/cmake/zlib.cmake b/cmake/zlib.cmake
index 4a9d2f011b..e4c94f5213 100644
--- a/cmake/zlib.cmake
+++ b/cmake/zlib.cmake
@@ -34,7 +34,12 @@ if("${gRPC_ZLIB_PROVIDER}" STREQUAL "module")
endif()
elseif("${gRPC_ZLIB_PROVIDER}" STREQUAL "package")
find_package(ZLIB REQUIRED)
- set(_gRPC_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
+
+ if(TARGET ZLIB::ZLIB)
+ set(_gRPC_ZLIB_LIBRARIES ZLIB::ZLIB)
+ else()
+ set(_gRPC_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
+ endif()
set(_gRPC_ZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIRS})
set(_gRPC_FIND_ZLIB "if(NOT ZLIB_FOUND)\n find_package(ZLIB)\nendif()")
endif()