diff options
author | Benoît Canet <benoit@scylladb.com> | 2016-09-26 16:25:11 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2016-10-17 18:28:45 +0000 |
commit | 47649d1c7fb6ba48b805e19268a711404eb6908b (patch) | |
tree | 603eea5969a564511df482a2d8d6a9525cfea74b /cmake | |
parent | 5c42d8a24c863549166bc1d0875e87a07bedf53e (diff) |
cql: add lz4 and snappy decompression
We do not use the STARTUP negotiation since a stream
can be captured in its middle but try to decompress
if the flag is present and fallback if it fails.
Change-Id: Iecbf49a45220b04be7808869c9884548eb1e7694
Signed-off-by: Benoît Canet <benoit@scylladb.com>
Reviewed-on: https://code.wireshark.org/review/17952
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindLZ4.cmake | 39 | ||||
-rw-r--r-- | cmake/modules/FindSNAPPY.cmake | 38 |
2 files changed, 77 insertions, 0 deletions
diff --git a/cmake/modules/FindLZ4.cmake b/cmake/modules/FindLZ4.cmake new file mode 100644 index 0000000000..5445c573ca --- /dev/null +++ b/cmake/modules/FindLZ4.cmake @@ -0,0 +1,39 @@ +# +# - Find lz4 +# 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. + +find_package(PkgConfig) +pkg_search_module(LZ4 lz4 liblz4) + +find_path(LZ4_INCLUDE_DIR + NAMES lz4.h + HINTS "${LZ4_INCLUDEDIR}" + PATHS + /usr/local/include + /usr/include +) + +find_library(LZ4_LIBRARY + NAMES lz4 liblz4 + HINTS "${LZ4_LIBDIR}" + PATHS + /usr/local/lib + /usr/lib +) + +include(FindPackageHandleStandardArgs) +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} ) +else() + set( LZ4_INCLUDE_DIRS ) + set( LZ4_LIBRARIES ) +endif() + +mark_as_advanced( LZ4_LIBRARIES LZ4_INCLUDE_DIRS ) diff --git a/cmake/modules/FindSNAPPY.cmake b/cmake/modules/FindSNAPPY.cmake new file mode 100644 index 0000000000..cc018bbcba --- /dev/null +++ b/cmake/modules/FindSNAPPY.cmake @@ -0,0 +1,38 @@ +# +# - Find snappy +# 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. + +find_package(PkgConfig) +pkg_search_module(SNAPPY libsnappy) + +find_path(SNAPPY_INCLUDE_DIR + NAMES snappy.h + HINTS "${SNAPPY_INCLUDEDIR}" + /usr/include + /usr/local/include +) + +find_library(SNAPPY_LIBRARY + NAMES snappy + HINTS "${SNAPPY_LIBDIR}" + PATHS + /usr/lib + /usr/local/lib +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( SNAPPY DEFAULT_MSG SNAPPY_INCLUDE_DIR SNAPPY_LIBRARY ) + +if( SNAPPY_FOUND ) + set( SNAPPY_INCLUDE_DIRS ${SNAPPY_INCLUDE_DIR} ) + set( SNAPPY_LIBRARIES ${SNAPPY_LIBRARY} ) +else() + set( SNAPPY_INCLUDE_DIRS ) + set( SNAPPY_LIBRARIES ) +endif() + +mark_as_advanced( SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIRS ) |