set(
	internal_curl_options

	"BUILD_CURL_EXE OFF"
	"BUILD_SHARED_LIBS ${SRB2_CONFIG_SHARED_INTERNAL_LIBRARIES}"
	"CURL_DISABLE_TESTS ON"
	"HTTP_ONLY ON"
	"USE_NGHTTP2 OFF"
	"CURL_DISABLE_CRYPTO_AUTH ON"
	"CURL_DISABLE_NTLM ON"
	"ENABLE_MANUAL OFF"
	"ENABLE_THREADED_RESOLVER OFF"
	"CURL_USE_LIBPSL OFF"
	"CURL_USE_LIBSSH2 OFF"
	"USE_LIBIDN2 OFF"
	"CURL_ENABLE_EXPORT_TARGET OFF"
	"BUILD_TESTING OFF"
	"BUILD_TESTING_STATIC OFF"
	"BUILD_TESTING_SHARED OFF"
	"BUILD_EXAMPLES OFF"

)
if(${CMAKE_SYSTEM} MATCHES Windows)
	list(APPEND internal_curl_options "CURL_USE_OPENSSL OFF")
	list(APPEND internal_curl_options "CURL_USE_SCHANNEL ON")
endif()
if(${CMAKE_SYSTEM} MATCHES Darwin)
	list(APPEND internal_curl_options "CURL_USE_OPENSSL OFF")
	list(APPEND internal_curl_options "CURL_USE_SECTRANSP ON")
endif()
if(${CMAKE_SYSTEM} MATCHES Linux)
	list(APPEND internal_curl_options "CURL_USE_OPENSSL ON")
endif()

CPMAddPackage(
		NAME curl
		VERSION 8.11.1
		URL "https://github.com/curl/curl/archive/refs/tags/curl-8_11_1.zip"
		EXCLUDE_FROM_ALL ON
		OPTIONS ${internal_curl_options}
)
