aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindZLIB.cmake
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2015-01-12 14:44:42 -0800
committerGerald Combs <gerald@wireshark.org>2015-01-13 19:25:10 +0000
commita988253fef15e6a0ddd05b0fb06e18ccde00082b (patch)
tree8f702426b7d49b13bb388b14869b36b96bf6a020 /cmake/modules/FindZLIB.cmake
parent42e40404294837b60af756dfbe0e6bb55cebaa21 (diff)
CMake: Copy libwireshark dependent DLLs to the target directory.
Add a "copy_cli_dlls" target which copies the DLLs required to run our command line programs to the run directory. Fix the spelling of "KERBEROS". Start filling in variables so that we can populate config.nsh. Change-Id: I9b3ed912dfbffecbf09f2893efa2c9d82e709521 Reviewed-on: https://code.wireshark.org/review/6513 Reviewed-by: Gerald Combs <gerald@wireshark.org>
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()
-