2
0

FindCURL.cmake 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # - Find curl
  2. # Find the native CURL headers and libraries.
  3. #
  4. # CURL_INCLUDE_DIR - where to find curl/curl.h, etc.
  5. # CURL_LIBRARY - List of libraries when using curl.
  6. # CURL_FOUND - True if curl found.
  7. if( UNIX )
  8. FIND_PATH(CURL_INCLUDE_DIR NAMES curl.h
  9. PATHS
  10. /usr/local/include/curl
  11. /usr/include/curl
  12. )
  13. FIND_LIBRARY(CURL_LIBRARY NAMES curl
  14. PATHS
  15. /usr/local/lib
  16. /usr/lib
  17. )
  18. else( UNIX )
  19. FIND_PATH(CURL_INCLUDE_DIR NAMES curl/curl.h) # Look for the header file.
  20. FIND_LIBRARY(CURL_LIBRARY NAMES curl) # Look for the library.
  21. INCLUDE(FindPackageHandleStandardArgs) # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
  22. FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL DEFAULT_MSG CURL_LIBRARY CURL_INCLUDE_DIR) # all listed variables are TRUE
  23. endif( UNIX )
  24. if( WIN32 )
  25. if( CURL_LIBRARY AND CURL_INCLUDE_DIR AND CURL_DLL ) # libcurl.dll is required on Windows
  26. SET(CURL_FOUND TRUE)
  27. else( CURL_LIBRARY AND CURL_INCLUDE_DIR AND CURL_DLL )
  28. SET(CURL_FOUND FALSE)
  29. endif( CURL_LIBRARY AND CURL_INCLUDE_DIR AND CURL_DLL )
  30. else ( WIN32 )
  31. if( CURL_LIBRARY AND CURL_INCLUDE_DIR )
  32. SET(CURL_FOUND TRUE)
  33. else( CURL_LIBRARY AND CURL_INCLUDE_DIR )
  34. SET(CURL_FOUND FALSE)
  35. endif( CURL_LIBRARY AND CURL_INCLUDE_DIR )
  36. endif ( WIN32 )
  37. MESSAGE(STATUS "CURL_INCLUDE_DIR = ${CURL_INCLUDE_DIR}")
  38. MESSAGE(STATUS "CURL_LIBRARY = ${CURL_LIBRARY}")