#
# 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.
#

set(THRIFT_VERSION @thrift_VERSION@)

@PACKAGE_INIT@

set_and_check(THRIFT_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(THRIFT_CMAKE_DIR "@PACKAGE_CMAKE_INSTALL_DIR@")
set_and_check(THRIFT_BIN_DIR "@PACKAGE_BIN_INSTALL_DIR@")
set(THRIFT_COMPILER "${THRIFT_BIN_DIR}/thrift@CMAKE_EXECUTABLE_SUFFIX@")

if (NOT TARGET thrift::thrift)
    include("${THRIFT_CMAKE_DIR}/thriftTargets.cmake")
endif()
set(THRIFT_LIBRARIES thrift::thrift)

if(@ZLIB_FOUND@ AND @WITH_ZLIB@)
    if (NOT TARGET thriftz::thriftz)
        include("${THRIFT_CMAKE_DIR}/thriftzTargets.cmake")
    endif()
    set(THRIFT_LIBRARIES thriftz::thriftz)
endif()

if ("${THRIFT_LIBRARIES}" STREQUAL "")
    message(FATAL_ERROR "thrift libraries were not found")
endif()
if (NOT Thrift_FIND_QUIETLY)
    message(STATUS "Found thrift: ${PACKAGE_PREFIX_DIR}")
endif()


include(CMakeFindDependencyMacro)

if(@ZLIB_FOUND@ AND @WITH_ZLIB@)
    find_dependency(ZLIB)
endif()

if(@OPENSSL_FOUND@ AND @WITH_OPENSSL@)
    find_dependency(OpenSSL)
endif()

if(@Libevent_FOUND@ AND @WITH_LIBEVENT@)
    find_dependency(Libevent)
endif()

check_required_components(Thrift)
