diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2016-10-17 21:04:49 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2016-10-18 04:00:35 +0000 |
commit | 303948500fee5f24600643638e3ed5cc5fa14132 (patch) | |
tree | ba35789f15a357782841066f76c1cf358bcf5945 /cmake/modules/FindSNAPPY.cmake | |
parent | 867f2829c1c4e1f67b14a5ace5cc9f29e971a6c9 (diff) | |
download | wireshark-303948500fee5f24600643638e3ed5cc5fa14132.tar.gz |
CQL: add LZ4/Snappy decompression support on Windows
Change-Id: I34374cf29357e2ed5062da1a5245b9adbabf732d
Reviewed-on: https://code.wireshark.org/review/18249
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'cmake/modules/FindSNAPPY.cmake')
-rw-r--r-- | cmake/modules/FindSNAPPY.cmake | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/cmake/modules/FindSNAPPY.cmake b/cmake/modules/FindSNAPPY.cmake index cc018bbcba..99e8b60fc4 100644 --- a/cmake/modules/FindSNAPPY.cmake +++ b/cmake/modules/FindSNAPPY.cmake @@ -3,22 +3,27 @@ # Find Snappy includes and library # # SNAPPY_INCLUDE_DIRS - where to find snappy.h, etc. -# SNAPPY_LIBRARIES - List of libraries when using snappy. -# SNAPPY_FOUND - True if snappy found. +# SNAPPY_LIBRARIES - List of libraries when using Snappy. +# SNAPPY_FOUND - True if Snappy found. +# SNAPPY_DLL_DIR - (Windows) Path to the Snappy DLL +# SNAPPY_DLL - (Windows) Name of the Snappy DLL + +include( FindWSWinLibs ) +FindWSWinLibs( "snappy-.*" "SNAPPY_HINTS" ) find_package(PkgConfig) pkg_search_module(SNAPPY libsnappy) find_path(SNAPPY_INCLUDE_DIR NAMES snappy.h - HINTS "${SNAPPY_INCLUDEDIR}" + HINTS "${SNAPPY_INCLUDEDIR}" "${SNAPPY_HINTS}/include" /usr/include /usr/local/include ) find_library(SNAPPY_LIBRARY NAMES snappy - HINTS "${SNAPPY_LIBDIR}" + HINTS "${SNAPPY_LIBDIR}" "${SNAPPY_HINTS}/lib" PATHS /usr/lib /usr/local/lib @@ -30,6 +35,19 @@ find_package_handle_standard_args( SNAPPY DEFAULT_MSG SNAPPY_INCLUDE_DIR SNAPPY_ if( SNAPPY_FOUND ) set( SNAPPY_INCLUDE_DIRS ${SNAPPY_INCLUDE_DIR} ) set( SNAPPY_LIBRARIES ${SNAPPY_LIBRARY} ) + if (WIN32) + set ( SNAPPY_DLL_DIR "${SNAPPY_HINTS}/bin" + CACHE PATH "Path to Snappy DLL" + ) + file( GLOB _snappy_dll RELATIVE "${SNAPPY_DLL_DIR}" + "${SNAPPY_DLL_DIR}/libsnappy-*.dll" + ) + set ( SNAPPY_DLL ${_snappy_dll} + # We're storing filenames only. Should we use STRING instead? + CACHE FILEPATH "Snappy DLL file name" + ) + mark_as_advanced( SNAPPY_DLL_DIR SNAPPY_DLL ) + endif() else() set( SNAPPY_INCLUDE_DIRS ) set( SNAPPY_LIBRARIES ) |