# CURL
option(FUN_WITH_CURL "Enable libcurl HTTP client support" OFF)
set(CURL_INCLUDE_DIRS "")
set(CURL_LINK_LIBS "")
if(FUN_WITH_CURL)
  add_definitions(-DFUN_WITH_CURL)
  find_package(PkgConfig QUIET)
  if(PKG_CONFIG_FOUND)
    pkg_check_modules(LIBCURL QUIET libcurl)
  endif()
  if(LIBCURL_FOUND)
    list(APPEND CURL_INCLUDE_DIRS ${LIBCURL_INCLUDE_DIRS})
    list(APPEND CURL_LINK_LIBS ${LIBCURL_LIBRARIES})
  else()
    list(APPEND CURL_LINK_LIBS curl)
  endif()
endif()
