diff --git a/cpp/cmake_modules/Findc-aresAlt.cmake b/cpp/cmake_modules/Findc-aresAlt.cmake deleted file mode 100644 index a769fb533ee..00000000000 --- a/cpp/cmake_modules/Findc-aresAlt.cmake +++ /dev/null @@ -1,41 +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. - -if(c-ares_ROOT) - find_library(CARES_LIB - NAMES cares - PATHS ${c-ares_ROOT} - PATH_SUFFIXES ${LIB_PATH_SUFFIXES} - NO_DEFAULT_PATH) - find_path(CARES_INCLUDE_DIR - NAMES ares.h - PATHS ${c-ares_ROOT} - NO_DEFAULT_PATH - PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}) -else() - find_library(CARES_LIB NAMES cares PATH_SUFFIXES ${LIB_PATH_SUFFIXES}) - find_path(CARES_INCLUDE_DIR NAMES ares.h PATH_SUFFIXES ${INCLUDE_PATH_SUFFIXES}) -endif() - -find_package_handle_standard_args(c-aresAlt REQUIRED_VARS CARES_INCLUDE_DIR CARES_LIB) - -if(c-aresAlt_FOUND) - add_library(c-ares::cares UNKNOWN IMPORTED) - set_target_properties(c-ares::cares - PROPERTIES IMPORTED_LOCATION "${CARES_LIB}" - INTERFACE_INCLUDE_DIRECTORIES "${CARES_INCLUDE_DIR}") -endif() diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index 2c4a4971dea..e9dfa07061b 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -2055,22 +2055,14 @@ endmacro() if(ARROW_WITH_GRPC) if(c-ares_SOURCE STREQUAL "AUTO") - find_package(c-ares QUIET) + find_package(c-ares QUIET CONFIG) if(NOT c-ares_FOUND) - # Fedora doesn't package the CMake config - find_package(c-aresAlt) - endif() - if(NOT c-ares_FOUND AND NOT c-aresAlt_FOUND) build_cares() endif() elseif(c-ares_SOURCE STREQUAL "BUNDLED") build_cares() elseif(c-ares_SOURCE STREQUAL "SYSTEM") - find_package(c-ares QUIET) - if(NOT c-ares_FOUND) - # Fedora doesn't package the CMake config - find_package(c-aresAlt REQUIRED) - endif() + find_package(c-ares REQUIRED CONFIG) endif() # TODO: Don't use global includes but rather target_include_directories