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
9 # http://www.apache.org/licenses/LICENSE-2.0
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
18 # - Find Arrow testing library
19 # (arrow/testing/util.h, libarrow_testing.a, libarrow_testing.so)
21 # This module requires Arrow from which it uses
22 # arrow_find_package()
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
33 if(DEFINED ARROW_TESTING_FOUND)
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}")
41 if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
42 list(APPEND find_package_arguments REQUIRED)
44 if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
45 list(APPEND find_package_arguments QUIET)
47 find_package(Arrow ${find_package_arguments})
50 arrow_find_package(ARROW_TESTING
56 if(NOT ARROW_TESTING_VERSION)
57 set(ARROW_TESTING_VERSION "${ARROW_VERSION}")
61 if("${ARROW_TESTING_VERSION}" VERSION_EQUAL "${ARROW_VERSION}")
62 set(ARROW_TESTING_VERSION_MATCH TRUE)
64 set(ARROW_TESTING_VERSION_MATCH FALSE)
67 mark_as_advanced(ARROW_TESTING_IMPORT_LIB
68 ARROW_TESTING_INCLUDE_DIR
71 ARROW_TESTING_SHARED_IMP_LIB
72 ARROW_TESTING_SHARED_LIB
73 ARROW_TESTING_STATIC_LIB
75 ARROW_TESTING_VERSION_MATCH)
77 find_package_handle_standard_args(
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})
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}")