From dcad21e5dc95c57f4b824158bfd263999d97e121 Mon Sep 17 00:00:00 2001 From: Yingchun Lai Date: Wed, 6 Dec 2023 08:56:10 +0800 Subject: [PATCH] try --- cmake_modules/BaseFunctions.cmake | 9 ++++++-- cmake_modules/Findlz4.cmake | 34 ------------------------------- cmake_modules/Findsnappy.cmake | 34 ------------------------------- cmake_modules/Findzstd.cmake | 34 ------------------------------- 4 files changed, 7 insertions(+), 104 deletions(-) delete mode 100644 cmake_modules/Findlz4.cmake delete mode 100644 cmake_modules/Findsnappy.cmake delete mode 100644 cmake_modules/Findzstd.cmake diff --git a/cmake_modules/BaseFunctions.cmake b/cmake_modules/BaseFunctions.cmake index 16e3a2ffcdd..09eb69593fb 100644 --- a/cmake_modules/BaseFunctions.cmake +++ b/cmake_modules/BaseFunctions.cmake @@ -327,13 +327,18 @@ function(dsn_setup_thirdparty_libs) set(DEFAULT_THIRDPARTY_LIBS ${THRIFT_LIB} fmt::fmt CACHE STRING "default thirdparty libs" FORCE) # rocksdb and dependent libs - find_package(snappy REQUIRED) + file(GLOB ROCKSDB_DEPENDS_MODULE_PATH ${THIRDPARTY_ROOT}/build/Source/rocksdb/cmake/modules) + if(NOT ROCKSDB_DEPENDS_MODULE_PATH) + message(WARNING "Cannot find RocksDB depends cmake modules path, might not find snappy, zstd, lz4") + endif() + list(APPEND CMAKE_MODULE_PATH "${ROCKSDB_DEPENDS_MODULE_PATH}") + find_package(Snappy REQUIRED) find_package(zstd REQUIRED) find_package(lz4 REQUIRED) if(USE_JEMALLOC) find_package(Jemalloc REQUIRED) endif() - find_package(RocksDB REQUIRED) + find_package(RocksDB) # libhdfs find_package(JNI REQUIRED) diff --git a/cmake_modules/Findlz4.cmake b/cmake_modules/Findlz4.cmake deleted file mode 100644 index 21404fdee1e..00000000000 --- a/cmake_modules/Findlz4.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# - Find LZ4 (lz4.h, liblz4.a) -# This module defines -# LZ4_INCLUDE_DIR, directory containing headers -# LZ4_STATIC_LIB, path to lz4's static library -# LZ4_FOUND, whether lz4 has been found - -find_path(LZ4_INCLUDE_DIR lz4.h - # make sure we don't accidentally pick up a different version - NO_CMAKE_SYSTEM_PATH - NO_SYSTEM_ENVIRONMENT_PATH) -find_library(LZ4_STATIC_LIB liblz4.a - NO_CMAKE_SYSTEM_PATH - NO_SYSTEM_ENVIRONMENT_PATH) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(lz4 REQUIRED_VARS - LZ4_STATIC_LIB LZ4_INCLUDE_DIR) diff --git a/cmake_modules/Findsnappy.cmake b/cmake_modules/Findsnappy.cmake deleted file mode 100644 index 51a1a5157d9..00000000000 --- a/cmake_modules/Findsnappy.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# - Find SNAPPY (snappy.h, libsnappy.a) -# This module defines -# SNAPPY_INCLUDE_DIR, directory containing headers -# SNAPPY_STATIC_LIB, path to snappy's static library -# SNAPPY_FOUND, whether snappy has been found - -find_path(SNAPPY_INCLUDE_DIR snappy.h - # make sure we don't accidentally pick up a different version - NO_CMAKE_SYSTEM_PATH - NO_SYSTEM_ENVIRONMENT_PATH) -find_library(SNAPPY_STATIC_LIB libsnappy.a - NO_CMAKE_SYSTEM_PATH - NO_SYSTEM_ENVIRONMENT_PATH) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(snappy REQUIRED_VARS - SNAPPY_STATIC_LIB SNAPPY_INCLUDE_DIR) diff --git a/cmake_modules/Findzstd.cmake b/cmake_modules/Findzstd.cmake deleted file mode 100644 index dcbf969782e..00000000000 --- a/cmake_modules/Findzstd.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -# - Find ZSTD (zstd.h, libzstd.a) -# This module defines -# ZSTD_INCLUDE_DIR, directory containing headers -# ZSTD_STATIC_LIB, path to zstd's static library -# ZSTD_FOUND, whether zstd has been found - -find_path(ZSTD_INCLUDE_DIR zstd.h - # make sure we don't accidentally pick up a different version - NO_CMAKE_SYSTEM_PATH - NO_SYSTEM_ENVIRONMENT_PATH) -find_library(ZSTD_STATIC_LIB libzstd.a - NO_CMAKE_SYSTEM_PATH - NO_SYSTEM_ENVIRONMENT_PATH) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(zstd REQUIRED_VARS - ZSTD_STATIC_LIB ZSTD_INCLUDE_DIR)