Commit 8e196911 authored by Marc Vef's avatar Marc Vef
Browse files

Merge branch 'rocksdb'

parents b27ddd5d 1e0f4083
Loading
Loading
Loading
Loading
+86 −0
Original line number Diff line number Diff line
# - Try to find GFlags
#
# The following variables are optionally searched for defaults
# GFlags_ROOT_DIR: Base directory where all GFlags components are found
#
# The following are set after configuration is done:
# GFlags_FOUND
# GFlags_INCLUDE_DIRS
# GFlags_LIBS
# GFlags_LIBRARY_DIRS
cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0011 OLD)

set(GFlags_ROOT_DIR)
if (WIN32)
    FIND_PATH(GFlags_ROOT_DIR
            src/gflags.cc
            HINTS
            $ENV{GFLAGS_ROOT})
else (WIN32)
    FIND_PATH(GFlags_ROOT_DIR
            libgflags.dylib
            HINTS
            /usr/local/lib
            )
endif (WIN32)

if (UNIX)
    FIND_PATH(GFlags_ROOT_DIR
            libgflags.so
            HINTS
            /usr/local/lib
            )
endif (UNIX)

IF (GFlags_ROOT_DIR)
    # We are testing only a couple of files in the include directories
    if (WIN32)
        FIND_PATH(GFlags_INCLUDE_DIRS
                gflags/gflags.h
                HINTS
                ${GFlags_ROOT_DIR}/src/windows
                )
    else (WIN32)
        FIND_PATH(GFlags_INCLUDE_DIRS
                gflags/gflags.h
                HINTS
                /usr/local/include
                ${GFlags_ROOT_DIR}/src
                )
    endif (WIN32)

    # Find the libraries
    SET(GFlags_LIBRARY_DIRS ${GFlags_ROOT_DIR})

    # TODO: This can use some per-component linking
    if (MSVC)
        SET(_gflags_libpath_suffixes /Release /Debug)
        FIND_LIBRARY(GFlags_lib_release
                NAMES libgflags
                HINTS
                ${GFlags_LIBRARY_DIRS}
                PATH_SUFFIXES ${_gflags_libpath_suffixes})
        FIND_LIBRARY(GFlags_lib_debug
                NAMES libgflags-debug
                HINTS
                ${GFlags_LIBRARY_DIRS}
                PATH_SUFFIXES ${_gflags_libpath_suffixes})
        SET(GFlags_lib optimized ${GFlags_lib_release} debug ${GFlags_lib_debug})
    else ()
        FIND_LIBRARY(GFlags_lib gflags ${GFlags_LIBRARY_DIRS})
    endif ()

    # set up include and link directory
    include_directories(${GFlags_INCLUDE_DIRS})
    link_directories(${GFlags_LIBRARY_DIRS})
    message(STATUS "gflags library found at ${GFlags_lib}")
    SET(GFlags_LIBS ${GFlags_lib})
    SET(GFlags_FOUND true)
    MARK_AS_ADVANCED(GFlags_INCLUDE_DIRS)
ELSE (GFlags_ROOT_DIR)
    FIND_PATH(GFlags_ROOT_DIR src)
    MARK_AS_ADVANCED(GFlags_ROOT_DIR)
    MESSAGE(STATUS "Cannot find Root directory of gflags")
    SET(GFlags_FOUND false)
ENDIF (GFlags_ROOT_DIR)
+39 −0
Original line number Diff line number Diff line
# Finds liblz4.
#
# This module defines:
# LZ4_FOUND
# LZ4_INCLUDE_DIR
# LZ4_LIBRARY
#

find_path(LZ4_INCLUDE_DIR NAMES lz4.h)
find_library(LZ4_LIBRARY NAMES lz4)

# We require LZ4_compress_default() which was added in v1.7.0
if (LZ4_LIBRARY)
    include(CheckCSourceRuns)
    set(CMAKE_REQUIRED_INCLUDES ${LZ4_INCLUDE_DIR})
    set(CMAKE_REQUIRED_LIBRARIES ${LZ4_LIBRARY})
    check_c_source_runs("
#include <lz4.h>
int main() {
  int good = (LZ4_VERSION_MAJOR > 1) ||
    ((LZ4_VERSION_MAJOR == 1) && (LZ4_VERSION_MINOR >= 7));
return !good;
}" LZ4_GOOD_VERSION)
    set(CMAKE_REQUIRED_INCLUDES)
    set(CMAKE_REQUIRED_LIBRARIES)
endif ()

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
        LZ4 DEFAULT_MSG
        LZ4_LIBRARY LZ4_INCLUDE_DIR LZ4_GOOD_VERSION)

if (NOT LZ4_FOUND)
    message(STATUS "Using third-party bundled LZ4")
else ()
    message(STATUS "Found LZ4: ${LZ4_LIBRARY}")
endif (NOT LZ4_FOUND)

mark_as_advanced(LZ4_INCLUDE_DIR LZ4_LIBRARY)
 No newline at end of file
+64 −0
Original line number Diff line number Diff line
# Try to find RocksDB headers and library.
#
# Usage of this module as follows:
#
#     find_package(RocksDB)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
#  ROCKSDB_ROOT_DIR          Set this variable to the root installation of
#                            RocksDB if the module has problems finding the
#                            proper installation path.
#
# Variables defined by this module:
#
#  ROCKSDB_FOUND               System has RocksDB library/headers.
#  ROCKSDB_LIBRARIES           The RocksDB library.
#  ROCKSDB_INCLUDE_DIRS        The location of RocksDB headers.

find_path(ROCKSDB_DIR
        HINTS
        /usr
        /usr/local
        /usr/local/adafs/
        )

find_path(ROCKSDB_INCLUDE_DIR rocksdb/db.h
        HINTS
        /home/evie/adafs/git/rocksdb
        /usr
        /usr/local
        /usr/local/adafs
        ${ROCKSDB_DIR}
        PATH_SUFFIXES include
        )

find_library(ROCKSDB_LIBRARY rocksdb
        HINTS
        /home/evie/adafs/git/rocksdb
        /usr
        /usr/local
        /usr/local/adafs
        ${ROCKSDB_DIR}
        PATH SUFFIXES lib
        PATH_SUFFIXES lib/rocksdb
        #        ${ROCKSDB_ROOT_DIR}/lib
        #        ${ROCKSDB_ROOT_DIR}/lib/rocksdb
        )

set(ROCKSDB_INCLUDE_DIRS ${ROCKSDB_INCLUDE_DIR})
set(ROCKSDB_LIBRARIES ${ROCKSDB_LIBRARY})


include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(RocksDB DEFAULT_MSG
        ROCKSDB_INCLUDE_DIR
        ROCKSDB_LIBRARY
        )

mark_as_advanced(
        ROCKSDB_DIR
        ROCKSDB_LIBRARY
        ROCKSDB_INCLUDE_DIR
)
 No newline at end of file
+33 −0
Original line number Diff line number Diff line
#
# - Try to find Facebook zstd library
# This will define
# ZSTD_FOUND
# ZSTD_INCLUDE_DIR
# ZSTD_LIBRARIES
#

find_path(
        ZSTD_INCLUDE_DIR
        NAMES "zstd.h"
        HINTS
        "/usr/include"
)

find_library(
        ZSTD_LIBRARY
        NAMES zstd
        HINTS
        "/usr/lib"
)

set(ZSTD_LIBRARIES ${ZSTD_LIBRARY})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
        ZSTD DEFAULT_MSG ZSTD_INCLUDE_DIR ZSTD_LIBRARIES)

mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARIES ZSTD_FOUND)

if (ZSTD_FOUND AND NOT ZSTD_FIND_QUIETLY)
    message(STATUS "ZSTD: ${ZSTD_INCLUDE_DIR}")
endif ()
 No newline at end of file
+36 −0
Original line number Diff line number Diff line

# This code is released under the
# Apache License Version 2.0 http://www.apache.org/licenses/.
#
# Copyright (c) 2012 Louis Dionne
#
# Find snappy compression library and includes. This module defines:
#   snappy_INCLUDE_DIRS - The directories containing snappy's headers.
#   snappy_LIBRARIES    - A list of snappy's libraries.
#   snappy_FOUND        - Whether snappy was found.
#
# This module can be controlled by setting the following variables:
#   snappy_ROOT - The root directory where to find snappy. If this is not
#                 set, the default paths are searched.

if (NOT snappy_ROOT)
    find_path(snappy_INCLUDE_DIRS snappy.h)
    find_library(snappy_LIBRARIES NAMES snappy)
else ()
    find_path(snappy_INCLUDE_DIRS snappy.h NO_DEFAULT_PATH PATHS ${snappy_ROOT})
    find_library(snappy_LIBRARIES NAMES snappy NO_DEFAULT_PATH PATHS ${snappy_ROOT})
endif ()

if (snappy_INCLUDE_DIRS AND snappy_LIBRARIES)
    set(snappy_FOUND TRUE)
else ()
    set(snappy_FOUND FALSE)
    set(snappy_INCLUDE_DIR)
    set(snappy_LIBRARIES)
endif ()

find_package_handle_standard_args(snappy DEFAULT_MSG
        snappy_INCLUDE_DIRS snappy_LIBRARIES
        )

mark_as_advanced(snappy_LIBRARIES snappy_INCLUDE_DIRS)
 No newline at end of file
Loading