CURL.cmake 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. set(_curl_platform_flags
  2. -DENABLE_IPV6:BOOL=ON
  3. -DENABLE_VERSIONED_SYMBOLS:BOOL=ON
  4. -DENABLE_THREADED_RESOLVER:BOOL=ON
  5. -DENABLE_MANUAL:BOOL=OFF
  6. -DCURL_DISABLE_LDAP:BOOL=ON
  7. -DCURL_DISABLE_LDAPS:BOOL=ON
  8. -DCURL_DISABLE_RTSP:BOOL=ON
  9. -DCURL_DISABLE_DICT:BOOL=ON
  10. -DCURL_DISABLE_TELNET:BOOL=ON
  11. -DCURL_DISABLE_POP3:BOOL=ON
  12. -DCURL_DISABLE_IMAP:BOOL=ON
  13. -DCURL_DISABLE_SMB:BOOL=ON
  14. -DCURL_DISABLE_SMTP:BOOL=ON
  15. -DCURL_DISABLE_GOPHER:BOOL=ON
  16. -DCURL_DISABLE_TFTP:BOOL=ON
  17. -DCURL_DISABLE_MQTT:BOOL=ON
  18. #-DHTTP_ONLY=ON
  19. -DCMAKE_USE_GSSAPI:BOOL=OFF
  20. -DCMAKE_USE_LIBSSH2:BOOL=OFF
  21. -DUSE_RTMP:BOOL=OFF
  22. -DUSE_NGHTTP2:BOOL=OFF
  23. -DUSE_MBEDTLS:BOOL=OFF
  24. )
  25. if (WIN32)
  26. set(_curl_platform_flags ${_curl_platform_flags} -DCMAKE_USE_SCHANNEL=ON)
  27. elseif (APPLE)
  28. set(_curl_platform_flags
  29. ${_curl_platform_flags}
  30. -DCMAKE_USE_SECTRANSP:BOOL=ON
  31. -DCMAKE_USE_OPENSSL:BOOL=OFF
  32. -DCURL_CA_PATH:STRING=none
  33. )
  34. elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
  35. set(_curl_platform_flags
  36. ${_curl_platform_flags}
  37. -DCMAKE_USE_OPENSSL:BOOL=ON
  38. -DCURL_CA_PATH:STRING=none
  39. -DCURL_CA_BUNDLE:STRING=none
  40. -DCURL_CA_FALLBACK:BOOL=ON
  41. )
  42. endif ()
  43. if (BUILD_SHARED_LIBS)
  44. set(_curl_static OFF)
  45. else()
  46. set(_curl_static ON)
  47. endif()
  48. bambustudio_add_cmake_project(CURL
  49. # GIT_REPOSITORY https://github.com/curl/curl.git
  50. # GIT_TAG curl-7_75_0
  51. URL https://github.com/curl/curl/archive/refs/tags/curl-7_75_0.zip
  52. URL_HASH SHA256=a63ae025bb0a14f119e73250f2c923f4bf89aa93b8d4fafa4a9f5353a96a765a
  53. DEPENDS ${ZLIB_PKG}
  54. # PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df &&
  55. # ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/curl-mods.patch
  56. CMAKE_ARGS
  57. -DBUILD_TESTING:BOOL=OFF
  58. -DCMAKE_POSITION_INDEPENDENT_CODE=ON
  59. -DCURL_STATICLIB=${_curl_static}
  60. ${_curl_platform_flags}
  61. )
  62. if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
  63. add_dependencies(dep_CURL dep_OpenSSL)
  64. endif ()
  65. if (MSVC)
  66. add_debug_dep(dep_CURL)
  67. endif ()