mark_as_advanced(CURL_INCLUDE_DIRS CURL_STATIC_LIB)

find_package(Threads REQUIRED CMAKE_THREAD_PREFER_PTHREAD)
find_path(CURL_INCLUDE_DIRS NAMES curl.h PATH_SUFFIXES curl)
find_library(CURL_STATIC_LIB NAMES libcurl.a)

if(CURL_INCLUDE_DIRS AND CURL_STATIC_LIB)
  set(CURL_FOUND ON)
  set(CURL_LIBRARIES ${CURL_STATIC_LIB} Threads::Threads dl)
  message("CURL Found ${CURL_LIBRARIES} ${CURL_INCLUDE_DIRS}")
else()
  message(FATAL_ERROR "CURL Not Found" )
  set(CURL-NOTFOUND ON)
endif()
