diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/rocksdb/cmake/modules | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/rocksdb/cmake/modules/FindJeMalloc.cmake | 29 | ||||
-rw-r--r-- | src/rocksdb/cmake/modules/FindNUMA.cmake | 29 | ||||
-rw-r--r-- | src/rocksdb/cmake/modules/FindTBB.cmake | 33 | ||||
-rw-r--r-- | src/rocksdb/cmake/modules/Findgflags.cmake | 29 | ||||
-rw-r--r-- | src/rocksdb/cmake/modules/Findlz4.cmake | 29 | ||||
-rw-r--r-- | src/rocksdb/cmake/modules/Findsnappy.cmake | 29 | ||||
-rw-r--r-- | src/rocksdb/cmake/modules/Findzstd.cmake | 29 | ||||
-rw-r--r-- | src/rocksdb/cmake/modules/ReadVersion.cmake | 10 |
8 files changed, 217 insertions, 0 deletions
diff --git a/src/rocksdb/cmake/modules/FindJeMalloc.cmake b/src/rocksdb/cmake/modules/FindJeMalloc.cmake new file mode 100644 index 000000000..f695b3ed1 --- /dev/null +++ b/src/rocksdb/cmake/modules/FindJeMalloc.cmake @@ -0,0 +1,29 @@ +# - Find JeMalloc library +# Find the native JeMalloc includes and library +# +# JeMalloc_INCLUDE_DIRS - where to find jemalloc.h, etc. +# JeMalloc_LIBRARIES - List of libraries when using jemalloc. +# JeMalloc_FOUND - True if jemalloc found. + +find_path(JeMalloc_INCLUDE_DIRS + NAMES jemalloc/jemalloc.h + HINTS ${JEMALLOC_ROOT_DIR}/include) + +find_library(JeMalloc_LIBRARIES + NAMES jemalloc + HINTS ${JEMALLOC_ROOT_DIR}/lib) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(JeMalloc DEFAULT_MSG JeMalloc_LIBRARIES JeMalloc_INCLUDE_DIRS) + +mark_as_advanced( + JeMalloc_LIBRARIES + JeMalloc_INCLUDE_DIRS) + +if(JeMalloc_FOUND AND NOT (TARGET JeMalloc::JeMalloc)) + add_library (JeMalloc::JeMalloc UNKNOWN IMPORTED) + set_target_properties(JeMalloc::JeMalloc + PROPERTIES + IMPORTED_LOCATION ${JeMalloc_LIBRARIES} + INTERFACE_INCLUDE_DIRECTORIES ${JeMalloc_INCLUDE_DIRS}) +endif() diff --git a/src/rocksdb/cmake/modules/FindNUMA.cmake b/src/rocksdb/cmake/modules/FindNUMA.cmake new file mode 100644 index 000000000..69b95c9b6 --- /dev/null +++ b/src/rocksdb/cmake/modules/FindNUMA.cmake @@ -0,0 +1,29 @@ +# - Find NUMA +# Find the NUMA library and includes +# +# NUMA_INCLUDE_DIRS - where to find numa.h, etc. +# NUMA_LIBRARIES - List of libraries when using NUMA. +# NUMA_FOUND - True if NUMA found. + +find_path(NUMA_INCLUDE_DIRS + NAMES numa.h numaif.h + HINTS ${NUMA_ROOT_DIR}/include) + +find_library(NUMA_LIBRARIES + NAMES numa + HINTS ${NUMA_ROOT_DIR}/lib) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(NUMA DEFAULT_MSG NUMA_LIBRARIES NUMA_INCLUDE_DIRS) + +mark_as_advanced( + NUMA_LIBRARIES + NUMA_INCLUDE_DIRS) + +if(NUMA_FOUND AND NOT (TARGET NUMA::NUMA)) + add_library (NUMA::NUMA UNKNOWN IMPORTED) + set_target_properties(NUMA::NUMA + PROPERTIES + IMPORTED_LOCATION ${NUMA_LIBRARIES} + INTERFACE_INCLUDE_DIRECTORIES ${NUMA_INCLUDE_DIRS}) +endif() diff --git a/src/rocksdb/cmake/modules/FindTBB.cmake b/src/rocksdb/cmake/modules/FindTBB.cmake new file mode 100644 index 000000000..f6861fa55 --- /dev/null +++ b/src/rocksdb/cmake/modules/FindTBB.cmake @@ -0,0 +1,33 @@ +# - Find TBB +# Find the Thread Building Blocks library and includes +# +# TBB_INCLUDE_DIRS - where to find tbb.h, etc. +# TBB_LIBRARIES - List of libraries when using TBB. +# TBB_FOUND - True if TBB found. + +if(NOT DEFINED TBB_ROOT_DIR) + set(TBB_ROOT_DIR "$ENV{TBBROOT}") +endif() + +find_path(TBB_INCLUDE_DIRS + NAMES tbb/tbb.h + HINTS ${TBB_ROOT_DIR}/include) + +find_library(TBB_LIBRARIES + NAMES tbb + HINTS ${TBB_ROOT_DIR}/lib ENV LIBRARY_PATH) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(TBB DEFAULT_MSG TBB_LIBRARIES TBB_INCLUDE_DIRS) + +mark_as_advanced( + TBB_LIBRARIES + TBB_INCLUDE_DIRS) + +if(TBB_FOUND AND NOT (TARGET TBB::TBB)) + add_library (TBB::TBB UNKNOWN IMPORTED) + set_target_properties(TBB::TBB + PROPERTIES + IMPORTED_LOCATION ${TBB_LIBRARIES} + INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIRS}) +endif() diff --git a/src/rocksdb/cmake/modules/Findgflags.cmake b/src/rocksdb/cmake/modules/Findgflags.cmake new file mode 100644 index 000000000..d9183fbf8 --- /dev/null +++ b/src/rocksdb/cmake/modules/Findgflags.cmake @@ -0,0 +1,29 @@ +# - Find gflags library +# Find the gflags includes and library +# +# gflags_INCLUDE_DIR - where to find gflags.h. +# gflags_LIBRARIES - List of libraries when using gflags. +# gflags_FOUND - True if gflags found. + +find_path(GFLAGS_INCLUDE_DIR + NAMES gflags/gflags.h) + +find_library(GFLAGS_LIBRARIES + NAMES gflags) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(gflags + DEFAULT_MSG GFLAGS_LIBRARIES GFLAGS_INCLUDE_DIR) + +mark_as_advanced( + GFLAGS_LIBRARIES + GFLAGS_INCLUDE_DIR) + +if(gflags_FOUND AND NOT (TARGET gflags::gflags)) + add_library(gflags::gflags UNKNOWN IMPORTED) + set_target_properties(gflags::gflags + PROPERTIES + IMPORTED_LOCATION ${GFLAGS_LIBRARIES} + INTERFACE_INCLUDE_DIRECTORIES ${GFLAGS_INCLUDE_DIR} + IMPORTED_LINK_INTERFACE_LANGUAGES "CXX") +endif() diff --git a/src/rocksdb/cmake/modules/Findlz4.cmake b/src/rocksdb/cmake/modules/Findlz4.cmake new file mode 100644 index 000000000..7cf7d7f5f --- /dev/null +++ b/src/rocksdb/cmake/modules/Findlz4.cmake @@ -0,0 +1,29 @@ +# - Find Lz4 +# Find the lz4 compression library and includes +# +# lz4_INCLUDE_DIRS - where to find lz4.h, etc. +# lz4_LIBRARIES - List of libraries when using lz4. +# lz4_FOUND - True if lz4 found. + +find_path(lz4_INCLUDE_DIRS + NAMES lz4.h + HINTS ${lz4_ROOT_DIR}/include) + +find_library(lz4_LIBRARIES + NAMES lz4 + HINTS ${lz4_ROOT_DIR}/lib) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(lz4 DEFAULT_MSG lz4_LIBRARIES lz4_INCLUDE_DIRS) + +mark_as_advanced( + lz4_LIBRARIES + lz4_INCLUDE_DIRS) + +if(lz4_FOUND AND NOT (TARGET lz4::lz4)) + add_library(lz4::lz4 UNKNOWN IMPORTED) + set_target_properties(lz4::lz4 + PROPERTIES + IMPORTED_LOCATION ${lz4_LIBRARIES} + INTERFACE_INCLUDE_DIRECTORIES ${lz4_INCLUDE_DIRS}) +endif() diff --git a/src/rocksdb/cmake/modules/Findsnappy.cmake b/src/rocksdb/cmake/modules/Findsnappy.cmake new file mode 100644 index 000000000..39bba6bd2 --- /dev/null +++ b/src/rocksdb/cmake/modules/Findsnappy.cmake @@ -0,0 +1,29 @@ +# - Find Snappy +# Find the snappy compression library and includes +# +# snappy_INCLUDE_DIRS - where to find snappy.h, etc. +# snappy_LIBRARIES - List of libraries when using snappy. +# snappy_FOUND - True if snappy found. + +find_path(snappy_INCLUDE_DIRS + NAMES snappy.h + HINTS ${snappy_ROOT_DIR}/include) + +find_library(snappy_LIBRARIES + NAMES snappy + HINTS ${snappy_ROOT_DIR}/lib) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(snappy DEFAULT_MSG snappy_LIBRARIES snappy_INCLUDE_DIRS) + +mark_as_advanced( + snappy_LIBRARIES + snappy_INCLUDE_DIRS) + +if(snappy_FOUND AND NOT (TARGET snappy::snappy)) + add_library (snappy::snappy UNKNOWN IMPORTED) + set_target_properties(snappy::snappy + PROPERTIES + IMPORTED_LOCATION ${snappy_LIBRARIES} + INTERFACE_INCLUDE_DIRECTORIES ${snappy_INCLUDE_DIRS}) +endif() diff --git a/src/rocksdb/cmake/modules/Findzstd.cmake b/src/rocksdb/cmake/modules/Findzstd.cmake new file mode 100644 index 000000000..9430821df --- /dev/null +++ b/src/rocksdb/cmake/modules/Findzstd.cmake @@ -0,0 +1,29 @@ +# - Find zstd +# Find the zstd compression library and includes +# +# zstd_INCLUDE_DIRS - where to find zstd.h, etc. +# zstd_LIBRARIES - List of libraries when using zstd. +# zstd_FOUND - True if zstd found. + +find_path(zstd_INCLUDE_DIRS + 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_DIRS) + +mark_as_advanced( + zstd_LIBRARIES + zstd_INCLUDE_DIRS) + +if(zstd_FOUND AND NOT (TARGET zstd::zstd)) + add_library (zstd::zstd UNKNOWN IMPORTED) + set_target_properties(zstd::zstd + PROPERTIES + IMPORTED_LOCATION ${zstd_LIBRARIES} + INTERFACE_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIRS}) +endif() diff --git a/src/rocksdb/cmake/modules/ReadVersion.cmake b/src/rocksdb/cmake/modules/ReadVersion.cmake new file mode 100644 index 000000000..ebfd7d6f9 --- /dev/null +++ b/src/rocksdb/cmake/modules/ReadVersion.cmake @@ -0,0 +1,10 @@ +# Read rocksdb version from version.h header file. + +function(get_rocksdb_version version_var) + file(READ "${CMAKE_CURRENT_SOURCE_DIR}/include/rocksdb/version.h" version_header_file) + foreach(component MAJOR MINOR PATCH) + string(REGEX MATCH "#define ROCKSDB_${component} ([0-9]+)" _ ${version_header_file}) + set(ROCKSDB_VERSION_${component} ${CMAKE_MATCH_1}) + endforeach() + set(${version_var} "${ROCKSDB_VERSION_MAJOR}.${ROCKSDB_VERSION_MINOR}.${ROCKSDB_VERSION_PATCH}" PARENT_SCOPE) +endfunction() |