if (WIN32)
  if (CMAKE_BUILD_TYPE STREQUAL Debug) 
    set(LIB_SUF "d")
  endif (CMAKE_BUILD_TYPE STREQUAL Debug) 
else (WIN32) 
  set(LIB_SUF "")
endif (WIN32)

FIND_PATH(CURL_INCLUDE_DIR curl/curl.h /usr/include /usr/local/include)
FIND_LIBRARY(CURL_LIBRARY NAMES curl${LIB_SUF} PATHS /usr/lib /usr/local/lib)

IF (CURL_INCLUDE_DIR AND CURL_LIBRARY)
   SET(CURL_FOUND TRUE)
ENDIF (CURL_INCLUDE_DIR AND CURL_LIBRARY)

IF (CURL_FOUND)
   IF (NOT Curl_FIND_QUIETLY)
      MESSAGE(STATUS "Found CURL: ${CURL_LIBRARY}")
   ENDIF (NOT Curl_FIND_QUIETLY)
ELSE (CURL_FOUND)
   IF (Curl_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find Curl")
   ENDIF (Curl_FIND_REQUIRED)
ENDIF (CURL_FOUND)
