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/FindLZ4.cmake | |
parent | 867f2829c1c4e1f67b14a5ace5cc9f29e971a6c9 (diff) |
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/FindLZ4.cmake')
-rw-r--r-- | cmake/modules/FindLZ4.cmake | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/cmake/modules/FindLZ4.cmake b/cmake/modules/FindLZ4.cmake index 5445c573ca..cbcd2b4659 100644 --- a/cmake/modules/FindLZ4.cmake +++ b/cmake/modules/FindLZ4.cmake @@ -3,15 +3,20 @@ # Find LZ4 includes and library # # LZ4_INCLUDE_DIRS - where to find lz4.h, etc. -# LZ4_LIBRARIES - List of libraries when using lz4. -# LZ4_FOUND - True if lz4 found. +# LZ4_LIBRARIES - List of libraries when using LZ4. +# LZ4_FOUND - True if LZ4 found. +# LZ4_DLL_DIR - (Windows) Path to the LZ4 DLL +# LZ4_DLL - (Windows) Name of the LZ4 DLL + +include( FindWSWinLibs ) +FindWSWinLibs( "lz4-.*" "LZ4_HINTS" ) find_package(PkgConfig) pkg_search_module(LZ4 lz4 liblz4) find_path(LZ4_INCLUDE_DIR NAMES lz4.h - HINTS "${LZ4_INCLUDEDIR}" + HINTS "${LZ4_INCLUDEDIR}" "${LZ4_HINTS}/include" PATHS /usr/local/include /usr/include @@ -19,7 +24,7 @@ find_path(LZ4_INCLUDE_DIR find_library(LZ4_LIBRARY NAMES lz4 liblz4 - HINTS "${LZ4_LIBDIR}" + HINTS "${LZ4_LIBDIR}" "${LZ4_HINTS}/lib" PATHS /usr/local/lib /usr/lib @@ -31,6 +36,19 @@ find_package_handle_standard_args( LZ4 DEFAULT_MSG LZ4_INCLUDE_DIR LZ4_LIBRARY ) if( LZ4_FOUND ) set( LZ4_INCLUDE_DIRS ${LZ4_INCLUDE_DIR} ) set( LZ4_LIBRARIES ${LZ4_LIBRARY} ) + if (WIN32) + set ( LZ4_DLL_DIR "${LZ4_HINTS}/bin" + CACHE PATH "Path to LZ4 DLL" + ) + file( GLOB _lz4_dll RELATIVE "${LZ4_DLL_DIR}" + "${LZ4_DLL_DIR}/liblz4-*.dll" + ) + set ( LZ4_DLL ${_lz4_dll} + # We're storing filenames only. Should we use STRING instead? + CACHE FILEPATH "LZ4 DLL file name" + ) + mark_as_advanced( LZ4_DLL_DIR LZ4_DLL ) + endif() else() set( LZ4_INCLUDE_DIRS ) set( LZ4_LIBRARIES ) |