aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindZLIB.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/modules/FindZLIB.cmake')
-rw-r--r--cmake/modules/FindZLIB.cmake23
1 files changed, 21 insertions, 2 deletions
diff --git a/cmake/modules/FindZLIB.cmake b/cmake/modules/FindZLIB.cmake
index 956046f075..9fcbb39032 100644
--- a/cmake/modules/FindZLIB.cmake
+++ b/cmake/modules/FindZLIB.cmake
@@ -6,6 +6,8 @@
# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
# ZLIB_LIBRARIES - List of libraries when using zlib.
# ZLIB_FOUND - True if zlib found.
+# ZLIB_DLL_DIR - (Windows) Path to the zlib DLL.
+# ZLIB_DLL - (Windows) Name of the zlib DLL.
#
# ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
# ZLIB_VERSION_MAJOR - The major version of zlib
@@ -88,7 +90,7 @@ CHECK_FUNCTION_EXISTS("inflatePrime" HAVE_INFLATEPRIME)
# reset
SET(CMAKE_REQUIRED_LIBRARIES "")
-# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
@@ -97,5 +99,22 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_D
IF(ZLIB_FOUND)
SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+ if (WIN32)
+ set ( ZLIB_DLL_DIR "${ZLIB_HINTS}"
+ CACHE PATH "Path to the Zlib DLL"
+ )
+ file( GLOB _zlib_dll RELATIVE "${ZLIB_DLL_DIR}"
+ "${ZLIB_DLL_DIR}/zlib1.dll"
+ )
+ set ( ZLIB_DLL ${_zlib_dll}
+ # We're storing filenames only. Should we use STRING instead?
+ CACHE FILEPATH "Zlib DLL file name"
+ )
+ mark_as_advanced( ZLIB_DLL_DIR ZLIB_DLL )
+ endif()
+ELSE()
+ SET(ZLIB_INCLUDE_DIRS )
+ SET(ZLIB_LIBRARIES )
+ SET(ZLIB_DLL_DIR )
+ SET(ZLIB_DLL )
ENDIF()
-