From 181dfe81def452a2671428bb187e2ae94cfad80f Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Sat, 9 Oct 2021 13:20:42 +0800 Subject: [PATCH] add leveldb and rocksdb deps --- CMakeLists.txt | 12 ++++++++++++ deps/CMakeLists.txt | 25 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ccad9e7a2d..190b693321 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,18 @@ cat("${CMAKE_SUPPORT_DIR}/zlib_CMakeLists.txt.in" ${DEPS_TMP_FILE}) ## cJson cat("${CMAKE_SUPPORT_DIR}/cjson_CMakeLists.txt.in" ${DEPS_TMP_FILE}) +## leveldb +option(BUILD_WITH_LEVELDB "If build with leveldb" ON) +if(${BUILD_WITH_LEVELDB}) + cat("${CMAKE_SUPPORT_DIR}/leveldb_CMakeLists.txt.in" ${DEPS_TMP_FILE}) +endif(${BUILD_WITH_LEVELDB}) + +## rocksdb +option(BUILD_WITH_ROCKSDB "If build with rocksdb" ON) +if(${BUILD_WITH_ROCKSDB}) + cat("${CMAKE_SUPPORT_DIR}/rocksdb_CMakeLists.txt.in" ${DEPS_TMP_FILE}) +endif(${BUILD_WITH_ROCKSDB}) + ## download dependencies configure_file(${DEPS_TMP_FILE} "${CMAKE_SOURCE_DIR}/deps/deps-download/CMakeLists.txt") execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 410e0c564e..a872de5fb8 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -1,7 +1,9 @@ +# googletest if(${BUILD_TEST}) add_subdirectory(googletest) endif(${BUILD_TEST}) +# cJson add_subdirectory(cJson) target_include_directories( cjson @@ -9,15 +11,38 @@ target_include_directories( PUBLIC $ ) +# lz4 add_subdirectory(lz4/build/cmake) target_include_directories( lz4_static PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/lz4/lib ) +# zlib add_subdirectory(zlib) target_include_directories( zlib PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/zlib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/zlib ) + +# leveldb +if(${BUILD_WITH_LEVELDB}) +option(LEVELDB_BUILD_TESTS "" OFF) + add_subdirectory(leveldb) + target_include_directories( + leveldb + PUBLIC $ + ) +endif(${BUILD_WITH_LEVELDB}) + +# rocksdb +if(${BUILD_WITH_ROCKSDB}) + option(WITH_TESTS "" OFF) + option(WITH_BENCHMARK_TOOLS "" OFF) + add_subdirectory(rocksdb) + target_include_directories( + rocksdb + PUBLIC $ + ) +endif(${BUILD_WITH_ROCKSDB}) -- GitLab