-# - Find curl
-# Find the native CURL headers and libraries.
-#
-# CURL_INCLUDE_DIR - where to find curl/curl.h, etc.
-# CURL_LIBRARY - List of libraries when using curl.
-# CURL_FOUND - True if curl found.
+mark_as_advanced(CURL_LIBRARY CURL_INCLUDE_DIR)
-# Look for the header file.
-FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h)
+find_library(CURL_LIBRARY NAMES curl libcurl)
+find_path(CURL_INCLUDE_DIR NAMES curl/curl.h)
-# Look for the library.
-FIND_LIBRARY(CURL_LIBRARY NAMES curl)
+if(WIN32)
+ # If VCPKG_APPLOCAL_DEPS is ON, dll's are automatically handled by VCPKG
+ if(NOT VCPKG_APPLOCAL_DEPS)
+ find_file(CURL_DLL NAMES libcurl-4.dll libcurl.dll
+ DOC "Path to the cURL DLL (for installation)")
+ mark_as_advanced(CURL_DLL)
+ endif()
+endif()
-# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
-# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR)