FIND_PACKAGE(CURL)
IF (CURL_FOUND)
  SET(HAVE_CURL 1)
  LIST(APPEND INCLUDES ${CURL_INCLUDE_DIRS})
  SET(POSTLINKFLAGS ${POSTLINKFLAGS} ${CURL_LIBRARIES})
ENDIF()

Is that Ok? @vigsterkr