diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 4b56f6bfa3..6ca0f32985 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -308,6 +308,18 @@ if(wxUSE_LIBLZMA) endif() endif() +if(wxUSE_WEBREQUEST_CURL) + find_package(CURL) + if(NOT CURL_FOUND) + message(WARNING "CURL not found, wxWebSessionBackendCURL won't be available") + wx_option_force_value(wxUSE_WEBREQUEST_CURL OFF) + endif() +endif() +if (wxUSE_WEBREQUEST AND NOT (wxUSE_WEBREQUEST_WINHTTP OR wxUSE_WEBREQUEST_URLSESSION OR wxUSE_WEBREQUEST_CURL)) + message(WARNING "wxUSE_WEBREQUEST requires at least one backend, it won't be available") + wx_option_force_value(wxUSE_WEBREQUEST OFF) +endif() + if(UNIX) if(wxUSE_SECRETSTORE AND NOT APPLE) # The required APIs are always available under MSW and OS X but we must diff --git a/build/cmake/lib/net/CMakeLists.txt b/build/cmake/lib/net/CMakeLists.txt index 8f670d45b2..1d4dd83c3e 100644 --- a/build/cmake/lib/net/CMakeLists.txt +++ b/build/cmake/lib/net/CMakeLists.txt @@ -32,8 +32,6 @@ if(WIN32) endif() if (wxUSE_WEBREQUEST_CURL) - find_package(CURL REQUIRED) - target_include_directories(wxnet PRIVATE ${CURL_INCLUDE_DIRS}) wx_lib_link_libraries(wxnet PRIVATE ${CURL_LIBRARIES}) endif() diff --git a/build/cmake/samples/CMakeLists.txt b/build/cmake/samples/CMakeLists.txt index 7e72043e53..e4d4f788f9 100644 --- a/build/cmake/samples/CMakeLists.txt +++ b/build/cmake/samples/CMakeLists.txt @@ -157,7 +157,7 @@ wx_add_sample(webview LIBRARIES wxwebview DATA ../help/doc.zip:doc.zip if(TARGET webviewsample AND wxUSE_STC) wx_exe_link_libraries(webviewsample wxstc) endif() -wx_add_sample(webrequest LIBRARIES net DEPENDS wxUSE_WEBREQUEST) +wx_add_sample(webrequest LIBRARIES wxnet DEPENDS wxUSE_WEBREQUEST) # widgets Sample set(SAMPLE_WIDGETS_SRC activityindicator.cpp