CMake: Improve webview checks
Try to match behavior of configure. Fix building webview sample with STC disabled.
This commit is contained in:
@@ -223,23 +223,39 @@ if(wxUSE_GUI)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(wxUSE_WEBVIEW AND WXGTK)
|
||||
find_package(LibSoup)
|
||||
if(WXGTK2)
|
||||
find_package(Webkit 1.0)
|
||||
elseif(WXGTK3)
|
||||
find_package(Webkit 3.0)
|
||||
find_package(Webkit2)
|
||||
if(NOT WEBKIT2_FOUND)
|
||||
wx_option_force_value(wxUSE_WEBVIEW_WEBKIT2 OFF)
|
||||
if(wxUSE_WEBVIEW)
|
||||
if(WXGTK)
|
||||
if(wxUSE_WEBVIEW_WEBKIT)
|
||||
find_package(LibSoup)
|
||||
if(WXGTK2)
|
||||
find_package(Webkit 1.0)
|
||||
elseif(WXGTK3)
|
||||
find_package(Webkit2)
|
||||
if(NOT WEBKIT2_FOUND)
|
||||
find_package(Webkit 3.0)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
set(wxUSE_WEBVIEW_WEBKIT OFF)
|
||||
set(wxUSE_WEBVIEW_WEBKIT2 OFF)
|
||||
if(WEBKIT_FOUND AND LIBSOUP_FOUND)
|
||||
set(wxUSE_WEBVIEW_WEBKIT ON)
|
||||
elseif(WEBKIT2_FOUND AND LIBSOUP_FOUND)
|
||||
set(wxUSE_WEBVIEW_WEBKIT2 ON)
|
||||
else()
|
||||
message(WARNING "webkit not found or enabled, wxWebview won't be available")
|
||||
wx_option_force_value(wxUSE_WEBVIEW OFF)
|
||||
endif()
|
||||
elseif(WXMSW)
|
||||
if(NOT wxUSE_WEBVIEW_IE)
|
||||
message(WARNING "WebviewIE not found or enabled, wxWebview won't be available")
|
||||
wx_option_force_value(wxUSE_WEBVIEW OFF)
|
||||
endif()
|
||||
elseif(APPLE)
|
||||
if(NOT wxUSE_WEBVIEW_WEBKIT)
|
||||
message(WARNING "webkit not found or enabled, wxWebview won't be available")
|
||||
wx_option_force_value(wxUSE_WEBVIEW OFF)
|
||||
endif()
|
||||
endif()
|
||||
if(NOT WEBKIT_FOUND)
|
||||
wx_option_force_value(wxUSE_WEBVIEW_WEBKIT OFF)
|
||||
endif()
|
||||
if((NOT WEBKIT_FOUND AND NOT WEBKIT2_FOUND) OR NOT LIBSOUP_FOUND)
|
||||
message(WARNING "webkit not found, wxWebview won't be available")
|
||||
wx_option_force_value(wxUSE_WEBVIEW OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
Reference in New Issue
Block a user