1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

Make WebView2 installation instructions more robust

This commit is contained in:
attila 2024-05-28 18:51:21 +02:00
parent 2cdb78e3e5
commit b9cb7d4fe3
2 changed files with 6 additions and 12 deletions

View file

@ -58,20 +58,12 @@ function(_juce_add_pips)
list(APPEND CMAKE_MODULE_PATH "${JUCE_CMAKE_UTILS_DIR}")
endif()
find_package(WebView2 QUIET)
find_package(WebView2)
if(NOT WebView2_FOUND)
list(REMOVE_ITEM headers "${CMAKE_CURRENT_SOURCE_DIR}/WebViewPluginDemo.h")
message(WARNING "The WebViewPluginDemo was not enabled because WebView2 wasn't found"
" in the the local NuGet folder"
"\n"
"To install NuGet and the WebView2 package containing the statically linked library, "
"open a PowerShell and issue the following commands"
"\n"
"> Register-PackageSource -provider NuGet -name nugetRepository -location https://www.nuget.org/api/v2\n"
"> Install-Package NuGet.CommandLine -Scope CurrentUser\n"
"> Install-Package Microsoft.Web.WebView2 -Scope CurrentUser -RequiredVersion 1.0.1901.177\n")
message(WARNING "The WebViewPluginDemo was not enabled because the WebView2 package wasn't found.")
endif()
endif()

View file

@ -71,8 +71,10 @@ elseif(NOT WebView2_FIND_QUIETLY)
"open a PowerShell and issue the following commands"
"\n"
"> Register-PackageSource -provider NuGet -name nugetRepository -location https://www.nuget.org/api/v2\n"
"> Install-Package NuGet.CommandLine -Scope CurrentUser\n"
"> Install-Package Microsoft.Web.WebView2 -Scope CurrentUser -RequiredVersion 1.0.1901.177\n")
"> Install-Package Microsoft.Web.WebView2 -Scope CurrentUser -RequiredVersion 1.0.1901.177 -Source nugetRepository\n"
"\n"
"Alternatively you can use the JUCE_WEBVIEW2_PACKAGE_LOCATION CMake variable to specify the directory "
"where this find script is looking for the *Microsoft.Web.WebView2* package directory.")
endif()
find_package_handle_standard_args(WebView2 DEFAULT_MSG WebView2_include_dir WebView2_library)