]> git.proxmox.com Git - ceph.git/blame - ceph/src/arrow/cpp/cmake_modules/FindArrowFlight.cmake
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / cpp / cmake_modules / FindArrowFlight.cmake
CommitLineData
1d09f67e
TL
1# Licensed to the Apache Software Foundation (ASF) under one
2# or more contributor license agreements. See the NOTICE file
3# distributed with this work for additional information
4# regarding copyright ownership. The ASF licenses this file
5# to you under the Apache License, Version 2.0 (the
6# "License"); you may not use this file except in compliance
7# with the License. You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing,
12# software distributed under the License is distributed on an
13# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14# KIND, either express or implied. See the License for the
15# specific language governing permissions and limitations
16# under the License.
17
18# - Find Arrow Flight (arrow/flight/api.h, libarrow_flight.a, libarrow_flight.so)
19#
20# This module requires Arrow from which it uses
21# arrow_find_package()
22#
23# This module defines
24# ARROW_FLIGHT_FOUND, whether Flight has been found
25# ARROW_FLIGHT_IMPORT_LIB,
26# path to libarrow_flight's import library (Windows only)
27# ARROW_FLIGHT_INCLUDE_DIR, directory containing headers
28# ARROW_FLIGHT_LIBS, deprecated. Use ARROW_FLIGHT_LIB_DIR instead
29# ARROW_FLIGHT_LIB_DIR, directory containing Flight libraries
30# ARROW_FLIGHT_SHARED_IMP_LIB, deprecated. Use ARROW_FLIGHT_IMPORT_LIB instead
31# ARROW_FLIGHT_SHARED_LIB, path to libarrow_flight's shared library
32# ARROW_FLIGHT_STATIC_LIB, path to libarrow_flight.a
33
34if(DEFINED ARROW_FLIGHT_FOUND)
35 return()
36endif()
37
38set(find_package_arguments)
39if(${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION)
40 list(APPEND find_package_arguments "${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION}")
41endif()
42if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
43 list(APPEND find_package_arguments REQUIRED)
44endif()
45if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
46 list(APPEND find_package_arguments QUIET)
47endif()
48find_package(Arrow ${find_package_arguments})
49
50if(ARROW_FOUND)
51 arrow_find_package(ARROW_FLIGHT
52 "${ARROW_HOME}"
53 arrow_flight
54 arrow/flight/api.h
55 ArrowFlight
56 arrow-flight)
57 if(NOT ARROW_FLIGHT_VERSION)
58 set(ARROW_FLIGHT_VERSION "${ARROW_VERSION}")
59 endif()
60endif()
61
62if("${ARROW_FLIGHT_VERSION}" VERSION_EQUAL "${ARROW_VERSION}")
63 set(ARROW_FLIGHT_VERSION_MATCH TRUE)
64else()
65 set(ARROW_FLIGHT_VERSION_MATCH FALSE)
66endif()
67
68mark_as_advanced(ARROW_FLIGHT_IMPORT_LIB
69 ARROW_FLIGHT_INCLUDE_DIR
70 ARROW_FLIGHT_LIBS
71 ARROW_FLIGHT_LIB_DIR
72 ARROW_FLIGHT_SHARED_IMP_LIB
73 ARROW_FLIGHT_SHARED_LIB
74 ARROW_FLIGHT_STATIC_LIB
75 ARROW_FLIGHT_VERSION
76 ARROW_FLIGHT_VERSION_MATCH)
77
78find_package_handle_standard_args(
79 ArrowFlight
80 REQUIRED_VARS ARROW_FLIGHT_INCLUDE_DIR ARROW_FLIGHT_LIB_DIR ARROW_FLIGHT_VERSION_MATCH
81 VERSION_VAR ARROW_FLIGHT_VERSION)
82set(ARROW_FLIGHT_FOUND ${ArrowFlight_FOUND})
83
84if(ArrowFlight_FOUND AND NOT ArrowFlight_FIND_QUIETLY)
85 message(STATUS "Found the Arrow Flight by ${ARROW_FLIGHT_FIND_APPROACH}")
86 message(STATUS "Found the Arrow Flight shared library: ${ARROW_FLIGHT_SHARED_LIB}")
87 message(STATUS "Found the Arrow Flight import library: ${ARROW_FLIGHT_IMPORT_LIB}")
88 message(STATUS "Found the Arrow Flight static library: ${ARROW_FLIGHT_STATIC_LIB}")
89endif()