aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake/zlib.cmake
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2018-01-19 08:17:29 +0100
committerGravatar GitHub <noreply@github.com>2018-01-19 08:17:29 +0100
commit461cf30159c0ada954e8e2a4e6591694f617809c (patch)
tree6c0f2b9cfe328d0ed724700449f39e709915b3bd /cmake/zlib.cmake
parent471a5dc18b4465b051cddf4e02dbdf44336f80ce (diff)
parentbb2f7e28edc3e3dd663ad308aed7ed632a0a17bf (diff)
Merge branch 'master' into cmake-export-fix
Diffstat (limited to 'cmake/zlib.cmake')
-rw-r--r--cmake/zlib.cmake18
1 files changed, 9 insertions, 9 deletions
diff --git a/cmake/zlib.cmake b/cmake/zlib.cmake
index e324802f65..e4c94f5213 100644
--- a/cmake/zlib.cmake
+++ b/cmake/zlib.cmake
@@ -16,15 +16,15 @@ if("${gRPC_ZLIB_PROVIDER}" STREQUAL "module")
if(NOT ZLIB_ROOT_DIR)
set(ZLIB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/zlib)
endif()
- set(ZLIB_INCLUDE_DIR "${ZLIB_ROOT_DIR}")
if(EXISTS "${ZLIB_ROOT_DIR}/CMakeLists.txt")
- # TODO(jtattermusch): workaround for https://github.com/madler/zlib/issues/218
- include_directories(${ZLIB_INCLUDE_DIR})
+ # TODO(jtattermusch): workaround for https://github.com/madler/zlib/issues/218
+ include_directories("${ZLIB_ROOT_DIR}")
+ add_subdirectory(${ZLIB_ROOT_DIR} third_party/zlib)
- add_subdirectory(${ZLIB_ROOT_DIR} third_party/zlib)
- if(TARGET zlibstatic)
- set(_gRPC_ZLIB_LIBRARIES zlibstatic)
- endif()
+ if(TARGET zlibstatic)
+ set(_gRPC_ZLIB_LIBRARIES zlibstatic)
+ set(_gRPC_ZLIB_INCLUDE_DIR "${ZLIB_ROOT_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib")
+ endif()
else()
message(WARNING "gRPC_ZLIB_PROVIDER is \"module\" but ZLIB_ROOT_DIR is wrong")
endif()
@@ -34,12 +34,12 @@ if("${gRPC_ZLIB_PROVIDER}" STREQUAL "module")
endif()
elseif("${gRPC_ZLIB_PROVIDER}" STREQUAL "package")
find_package(ZLIB REQUIRED)
-
+
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()