summaryrefslogtreecommitdiff
path: root/cmake/modules/FindGCRYPT.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/FindGCRYPT.cmake
parent42e40404294837b60af756dfbe0e6bb55cebaa21 (diff)
downloadwireshark-a988253fef15e6a0ddd05b0fb06e18ccde00082b.tar.gz
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/FindGCRYPT.cmake')
-rw-r--r--cmake/modules/FindGCRYPT.cmake29
1 files changed, 24 insertions, 5 deletions
diff --git a/cmake/modules/FindGCRYPT.cmake b/cmake/modules/FindGCRYPT.cmake
index 1ff89724ab..0b4271a8ed 100644
--- a/cmake/modules/FindGCRYPT.cmake
+++ b/cmake/modules/FindGCRYPT.cmake
@@ -5,6 +5,8 @@
# GCRYPT_INCLUDE_DIRS - where to find gcrypt.h, etc.
# GCRYPT_LIBRARIES - List of libraries when using gcrypt.
# GCRYPT_FOUND - True if gcrypt found.
+# GCRYPT_DLL_DIR - (Windows) Path to the Libgcrypt DLLs.
+# GCRYPT_DLLS - (Windows) List of required Libgcrypt DLLs.
IF (GCRYPT_INCLUDE_DIRS)
@@ -16,17 +18,17 @@ INCLUDE(FindWSWinLibs)
FindWSWinLibs("gnutls-.*" "GCRYPT_HINTS")
FIND_PATH(GCRYPT_INCLUDE_DIR gcrypt.h
- HINTS
- "${GCRYPT_HINTS}"
- PATH_SUFFIXES
- include
+ HINTS
+ "${GCRYPT_HINTS}"
+ PATH_SUFFIXES
+ include
)
SET(GCRYPT_NAMES gcrypt libgcrypt-20)
FIND_LIBRARY(GCRYPT_LIBRARY NAMES ${GCRYPT_NAMES} libgcc_s_sjlj-1 HINTS "${GCRYPT_HINTS}/bin")
FIND_LIBRARY(GCRYPT_ERROR_LIBRARY NAMES gpg-error libgpg-error-0 libgpg-error6-0 HINTS "${GCRYPT_HINTS}/bin")
-# handle the QUIETLY and REQUIRED arguments and set GCRYPT_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set GCRYPT_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GCRYPT DEFAULT_MSG GCRYPT_LIBRARY GCRYPT_INCLUDE_DIR)
@@ -34,9 +36,26 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(GCRYPT DEFAULT_MSG GCRYPT_LIBRARY GCRYPT_INCLU
IF(GCRYPT_FOUND)
SET( GCRYPT_LIBRARIES ${GCRYPT_LIBRARY} ${GCRYPT_ERROR_LIBRARY})
SET( GCRYPT_INCLUDE_DIRS ${GCRYPT_INCLUDE_DIR})
+ if (WIN32)
+ set ( GCRYPT_DLL_DIR "${GCRYPT_HINTS}/bin"
+ CACHE PATH "Path to the Libgcrypt DLLs"
+ )
+ file( GLOB _gcrypt_dlls RELATIVE "${GCRYPT_DLL_DIR}"
+ "${GCRYPT_DLL_DIR}/libgcc_s_*.dll"
+ "${GCRYPT_DLL_DIR}/libgcrypt-*.dll"
+ "${GCRYPT_DLL_DIR}/libgpg-error*.dll"
+ )
+ set ( GCRYPT_DLLS ${_gcrypt_dlls}
+ # We're storing filenames only. Should we use STRING instead?
+ CACHE FILEPATH "Libgcrypt DLL list"
+ )
+ mark_as_advanced( GCRYPT_DLL_DIR GCRYPT_DLLS )
+ endif()
ELSE(GCRYPT_FOUND)
SET( GCRYPT_LIBRARIES )
SET( GCRYPT_INCLUDE_DIRS )
+ SET( GCRYPT_DLL_DIR )
+ SET( GCRYPT_DLLS )
ENDIF(GCRYPT_FOUND)
MARK_AS_ADVANCED( GCRYPT_LIBRARIES GCRYPT_INCLUDE_DIRS )