From: Radoslaw Zarzynski Date: Wed, 5 Dec 2018 08:21:06 +0000 (+0100) Subject: cmake does support extra compressions algorithms for Luminous X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fheads%2Ftesting-luminous-compalgos-in-rocksdb;p=rocksdb.git cmake does support extra compressions algorithms for Luminous Fixes: http://tracker.ceph.com/issues/22534 Signed-off-by: Radoslaw Zarzynski --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 983f0be9..9363191c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,7 @@ else() include_directories(${JEMALLOC_INCLUDE_DIR}) endif() endif() + option(WITH_SNAPPY "build with SNAPPY" OFF) if(WITH_SNAPPY) find_package(snappy REQUIRED) @@ -63,6 +64,30 @@ else() include_directories(${SNAPPY_INCLUDE_DIR}) list(APPEND THIRDPARTY_LIBS ${SNAPPY_LIBRARIES}) endif() + + option(WITH_LZ4 "build with lz4" OFF) + if(WITH_LZ4) + find_package(lz4 REQUIRED) + add_definitions(-DLZ4) + include_directories(${LZ4_INCLUDE_DIR}) + list(APPEND THIRDPARTY_LIBS ${LZ4_LIBRARIES}) + endif() + + option(WITH_ZLIB "build with zlib" OFF) + if(WITH_ZLIB) + find_package(zlib REQUIRED) + add_definitions(-DZLIB) + include_directories(${ZLIB_INCLUDE_DIR}) + list(APPEND THIRDPARTY_LIBS ${ZLIB_LIBRARIES}) + endif() + + option(WITH_ZSTD "build with zstd" OFF) + if(WITH_ZSTD) + find_package(zstd REQUIRED) + add_definitions(-DZSTD) + include_directories(${ZSTD_INCLUDE_DIR}) + list(APPEND THIRDPARTY_LIBS ${ZSTD_LIBRARIES}) + endif() endif() if(WIN32) diff --git a/cmake/modules/Findzlib.cmake b/cmake/modules/Findzlib.cmake new file mode 100644 index 00000000..fb5aee9b --- /dev/null +++ b/cmake/modules/Findzlib.cmake @@ -0,0 +1,21 @@ +# - Find zlib +# Find the zlib compression library and includes +# +# ZLIB_INCLUDE_DIR - where to find zlib.h, etc. +# ZLIB_LIBRARIES - List of libraries when using zlib. +# ZLIB_FOUND - True if zlib found. + +find_path(ZLIB_INCLUDE_DIR + NAMES zlib.h + HINTS ${ZLIB_ROOT_DIR}/include) + +find_library(ZLIB_LIBRARIES + NAMES z + HINTS ${ZLIB_ROOT_DIR}/lib) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(zlib DEFAULT_MSG ZLIB_LIBRARIES ZLIB_INCLUDE_DIR) + +mark_as_advanced( + ZLIB_LIBRARIES + ZLIB_INCLUDE_DIR) diff --git a/cmake/modules/Findzstd.cmake b/cmake/modules/Findzstd.cmake new file mode 100644 index 00000000..a2964aa9 --- /dev/null +++ b/cmake/modules/Findzstd.cmake @@ -0,0 +1,21 @@ +# - Find zstd +# Find the zstd compression library and includes +# +# ZSTD_INCLUDE_DIR - where to find zstd.h, etc. +# ZSTD_LIBRARIES - List of libraries when using zstd. +# ZSTD_FOUND - True if zstd found. + +find_path(ZSTD_INCLUDE_DIR + NAMES zstd.h + HINTS ${ZSTD_ROOT_DIR}/include) + +find_library(ZSTD_LIBRARIES + NAMES zstd + HINTS ${ZSTD_ROOT_DIR}/lib) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(zstd DEFAULT_MSG ZSTD_LIBRARIES ZSTD_INCLUDE_DIR) + +mark_as_advanced( + ZSTD_LIBRARIES + ZSTD_INCLUDE_DIR)