You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2019/07/08 17:40:18 UTC
[arrow] branch master updated: ARROW-5827: [C++] Require c-ares
CMake config
This is an automated email from the ASF dual-hosted git repository.
wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 308b851 ARROW-5827: [C++] Require c-ares CMake config
308b851 is described below
commit 308b8515f2c2e82debdf247157bbc97a2427f6b3
Author: Sutou Kouhei <ko...@clear-code.com>
AuthorDate: Mon Jul 8 12:36:49 2019 -0500
ARROW-5827: [C++] Require c-ares CMake config
Because gRPC requires c-ares CMake config.
See also: https://lists.apache.org/thread.html/babb7985a8206807dd8893a2c7affdb733f3d561ecfcc7f26ba660d9@%3Cdev.arrow.apache.org%3E
Author: Sutou Kouhei <ko...@clear-code.com>
Closes #4783 from kou/cpp-c-ares-require-cmake-config and squashes the following commits:
7fe27842b <Sutou Kouhei> Require c-ares CMake config
---
cpp/cmake_modules/Findc-aresAlt.cmake | 41 -----------------------------
cpp/cmake_modules/ThirdpartyToolchain.cmake | 12 ++-------
2 files changed, 2 insertions(+), 51 deletions(-)
diff --git a/cpp/cmake_modules/Findc-aresAlt.cmake b/cpp/cmake_modules/Findc-aresAlt.cmake
deleted file mode 100644
index a769fb5..0000000
--- 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 2c4a497..e9dfa07 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