FindCURL.cmake 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # - Find curl
  2. # Find the native CURL headers and libraries.
  3. #
  4. # CURL_INCLUDE_DIRS - where to find curl/curl.h, etc.
  5. # CURL_LIBRARIES - List of libraries when using curl.
  6. # CURL_FOUND - True if curl found.
  7. #=============================================================================
  8. # Copyright 2006-2009 Kitware, Inc.
  9. #
  10. # Distributed under the OSI-approved BSD License (the "License");
  11. # see accompanying file Copyright.txt for details.
  12. #
  13. # This software is distributed WITHOUT ANY WARRANTY; without even the
  14. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. # See the License for more information.
  16. #=============================================================================
  17. # (To distribute this file outside of CMake, substitute the full
  18. # License text for the above reference.)
  19. # Look for the header file.
  20. FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h)
  21. MARK_AS_ADVANCED(CURL_INCLUDE_DIR)
  22. # Look for the library.
  23. FIND_LIBRARY(CURL_LIBRARY NAMES
  24. curl
  25. # Windows MSVC prebuilts:
  26. curllib
  27. libcurl_imp
  28. curllib_static
  29. )
  30. MARK_AS_ADVANCED(CURL_LIBRARY)
  31. # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
  32. # all listed variables are TRUE
  33. INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  34. FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR)
  35. IF(CURL_FOUND)
  36. SET(CURL_LIBRARIES ${CURL_LIBRARY})
  37. SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
  38. ENDIF(CURL_FOUND)