# Juce with Cmake and WebView2 support

**URL:** <https://forum.juce.com/t/juce-with-cmake-and-webview2-support/51642>\
**Category:** General JUCE discussion\
**Created:** [May 29, 2022, 8:15am UTC](https://forum.juce.com/t/juce-with-cmake-and-webview2-support/51642 "2022-05-29T08:15:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![equinox](https://avatars.discourse-cdn.com/v4/letter/e/47e85d/32.png) [@equinox](https://forum.juce.com/u/equinox)\
**Post date:** [May 29, 2022, 8:15am UTC](https://forum.juce.com/t/juce-with-cmake-and-webview2-support/51642/1 "2022-05-29T08:15:33Z")

</div>

Hi,

I like the juce CMake support very much. Now I wanted to use Edge/Webview2 instead of IE on Windows, and stumbled across this:

> WebView2 on Windows via JUCE\_USE\_WIN\_WEBVIEW2 flag in juce\_gui\_extra is not currently supported.

Going back to the Projucer is no solution for my project, so what is the proper way of getting WebView2 to work under windows with CMake?

A step by step instruction or something like that would be really much appreciated …

I allready tried to install WebView2 with NugetManager (works and gives me a WebView2.dll in my build folder somewhere), and I tried to give this dll to juce::WindowsWebView2WebBrowserComponent(), but somehow it seems that this is not working:

```auto
WindowsWebView2WebBrowserComponent::WindowsWebView2WebBrowserComponent (bool unloadWhenHidden,
                                                                        const WebView2Preferences& preferences)
    : WebBrowserComponent (ConstructWithoutPimpl { unloadWhenHidden })
{
    browser = std::make_unique<Pimpl> (*this, preferences, true);
}

```

browser seems to be null and I think as a fallback still IE is used.

Best,

equinox

---

<div class="post-metadata">

**Author:** ![equinox](https://avatars.discourse-cdn.com/v4/letter/e/47e85d/32.png) [@equinox](https://forum.juce.com/u/equinox)\
**Post date:** [May 30, 2022, 8:37am UTC](https://forum.juce.com/t/juce-with-cmake-and-webview2-support/51642/2 "2022-05-30T08:37:51Z")

</div>

Ok somehow found a solution by using the content of the nuget file and bringing it into my cmake-project.

---

<div class="post-metadata">

**Author:** ![dacro](https://avatars.discourse-cdn.com/v4/letter/d/54ee81/32.png) [@dacro](https://forum.juce.com/u/dacro)\
**Post date:** [March 19, 2024, 11:39am UTC](https://forum.juce.com/t/juce-with-cmake-and-webview2-support/51642/3 "2024-03-19T11:39:49Z")

</div>

Can you please post your solution here?

I found this one, but are not able to get it running:

> [@WebView2 with JUCE 7.0.3 and CMake](https://forum.juce.com/t/webview2-with-juce-7-0-3-and-cmake/54015/2):
>
> Hey there, sorry for the late reply, just seeing your question. It’s a bit of a hassle but I made it work with the nuget approach. I donwloaded the nuget binary and put it somewher in my path. Then in my plugin cmake I added these lines if(MSVC) find\_program(NUGET\_EXE NAMES nuget) if(NOT NUGET\_EXE) message("NUGET.EXE not found.") message(FATAL\_ERROR "Please install this executable, and run CMake again.") endif() execute\_process(COMMAND ${NUGET\_EXE} install "Micro…
