CURL.cmake 2.0 KB

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