]> git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/cpp/cmake_modules/FindArrowTesting.cmake
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / cpp / cmake_modules / FindArrowTesting.cmake
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 testing library
19 # (arrow/testing/util.h, libarrow_testing.a, libarrow_testing.so)
20 #
21 # This module requires Arrow from which it uses
22 # arrow_find_package()
23 #
24 # This module defines
25 # ARROW_TESTING_FOUND, whether Arrow testing library has been found
26 # ARROW_TESTING_IMPORT_LIB,
27 # path to libarrow_testing's import library (Windows only)
28 # ARROW_TESTING_INCLUDE_DIR, directory containing headers
29 # ARROW_TESTING_LIB_DIR, directory containing Arrow testing libraries
30 # ARROW_TESTING_SHARED_LIB, path to libarrow_testing's shared library
31 # ARROW_TESTING_STATIC_LIB, path to libarrow_testing.a
32
33 if(DEFINED ARROW_TESTING_FOUND)
34 return()
35 endif()
36
37 set(find_package_arguments)
38 if(${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION)
39 list(APPEND find_package_arguments "${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION}")
40 endif()
41 if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
42 list(APPEND find_package_arguments REQUIRED)
43 endif()
44 if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
45 list(APPEND find_package_arguments QUIET)
46 endif()
47 find_package(Arrow ${find_package_arguments})
48
49 if(ARROW_FOUND)
50 arrow_find_package(ARROW_TESTING
51 "${ARROW_HOME}"
52 arrow_testing
53 arrow/testing/util.h
54 ArrowTesting
55 arrow-testing)
56 if(NOT ARROW_TESTING_VERSION)
57 set(ARROW_TESTING_VERSION "${ARROW_VERSION}")
58 endif()
59 endif()
60
61 if("${ARROW_TESTING_VERSION}" VERSION_EQUAL "${ARROW_VERSION}")
62 set(ARROW_TESTING_VERSION_MATCH TRUE)
63 else()
64 set(ARROW_TESTING_VERSION_MATCH FALSE)
65 endif()
66
67 mark_as_advanced(ARROW_TESTING_IMPORT_LIB
68 ARROW_TESTING_INCLUDE_DIR
69 ARROW_TESTING_LIBS
70 ARROW_TESTING_LIB_DIR
71 ARROW_TESTING_SHARED_IMP_LIB
72 ARROW_TESTING_SHARED_LIB
73 ARROW_TESTING_STATIC_LIB
74 ARROW_TESTING_VERSION
75 ARROW_TESTING_VERSION_MATCH)
76
77 find_package_handle_standard_args(
78 ArrowTesting
79 REQUIRED_VARS ARROW_TESTING_INCLUDE_DIR ARROW_TESTING_LIB_DIR
80 ARROW_TESTING_VERSION_MATCH
81 VERSION_VAR ARROW_TESTING_VERSION)
82 set(ARROW_TESTING_FOUND ${ArrowTesting_FOUND})
83
84 if(ArrowTesting_FOUND AND NOT ArrowTesting_FIND_QUIETLY)
85 message(STATUS "Found the Arrow testing by ${ARROW_TESTING_FIND_APPROACH}")
86 message(STATUS "Found the Arrow testing shared library: ${ARROW_TESTING_SHARED_LIB}")
87 message(STATUS "Found the Arrow testing import library: ${ARROW_TESTING_IMPORT_LIB}")
88 message(STATUS "Found the Arrow testing static library: ${ARROW_TESTING_STATIC_LIB}")
89 endif()