2024-10-11 19:40:20 +08:00
|
|
|
#***************************************************************************
|
|
|
|
# _ _ ____ _
|
|
|
|
# Project ___| | | | _ \| |
|
|
|
|
# / __| | | | |_) | |
|
|
|
|
# | (__| |_| | _ <| |___
|
|
|
|
# \___|\___/|_| \_\_____|
|
|
|
|
#
|
|
|
|
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
|
|
#
|
|
|
|
# This software is licensed as described in the file COPYING, which
|
|
|
|
# you should have received as part of this distribution. The terms
|
|
|
|
# are also available at https://curl.se/docs/copyright.html.
|
|
|
|
#
|
|
|
|
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
# copies of the Software, and permit persons to whom the Software is
|
|
|
|
# furnished to do so, under the terms of the COPYING file.
|
|
|
|
#
|
|
|
|
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
# KIND, either express or implied.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: curl
|
|
|
|
#
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
|
|
|
|
####### Any changes to this file will be overwritten by the next CMake run ####
|
|
|
|
####### The input file was curl-config.cmake.in ########
|
|
|
|
|
|
|
|
get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
|
|
|
|
|
|
|
|
macro(set_and_check _var _file)
|
|
|
|
set(${_var} "${_file}")
|
|
|
|
if(NOT EXISTS "${_file}")
|
|
|
|
message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
|
|
|
|
endif()
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
macro(check_required_components _NAME)
|
|
|
|
foreach(comp ${${_NAME}_FIND_COMPONENTS})
|
|
|
|
if(NOT ${_NAME}_${comp}_FOUND)
|
|
|
|
if(${_NAME}_FIND_REQUIRED_${comp})
|
|
|
|
set(${_NAME}_FOUND FALSE)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
endmacro()
|
|
|
|
|
|
|
|
####################################################################################
|
|
|
|
|
|
|
|
if(UNIX OR VCPKG_TOOLCHAIN OR (MINGW AND NOT CMAKE_CROSSCOMPILING)) # Keep in sync with root CMakeLists.txt
|
|
|
|
set(_curl_use_pkgconfig_default ON)
|
|
|
|
else()
|
|
|
|
set(_curl_use_pkgconfig_default OFF)
|
|
|
|
endif()
|
|
|
|
option(CURL_USE_PKGCONFIG "Enable pkg-config to detect CURL dependencies" ${_curl_use_pkgconfig_default})
|
|
|
|
|
|
|
|
include(CMakeFindDependencyMacro)
|
2024-10-11 19:49:24 +08:00
|
|
|
if("")
|
|
|
|
find_dependency(OpenSSL "")
|
2024-10-11 19:40:20 +08:00
|
|
|
endif()
|
2024-10-11 19:49:24 +08:00
|
|
|
if("OFF")
|
|
|
|
find_dependency(ZLIB "")
|
2024-10-11 19:40:20 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/CURLTargets.cmake")
|
|
|
|
check_required_components("CURL")
|
|
|
|
|
|
|
|
# Alias for either shared or static library
|
|
|
|
if(NOT TARGET CURL::libcurl)
|
2024-10-11 19:49:24 +08:00
|
|
|
add_library(CURL::libcurl ALIAS CURL::libcurl_shared)
|
2024-10-11 19:40:20 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# For compatibility with CMake's FindCURL.cmake
|
|
|
|
set(CURL_LIBRARIES CURL::libcurl)
|
|
|
|
set_and_check(CURL_INCLUDE_DIRS "${PACKAGE_PREFIX_DIR}/include")
|