# FindwxWidgets.cmake on Windows on ARM support is broken

**URL:** https://discourse.cmake.org/t/findwxwidgets-cmake-on-windows-on-arm-support-is-broken/15760
**Category:** Development
**Tags:** os:windows
**Created:** [July 24, 2026, 11:06pm UTC](https://discourse.cmake.org/t/findwxwidgets-cmake-on-windows-on-arm-support-is-broken/15760 "2026-07-24T23:06:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Noisyfox](https://discourse.cmake.org/user_avatar/discourse.cmake.org/noisyfox/32/6191_2.png) [@Noisyfox](https://discourse.cmake.org/u/Noisyfox)
#### Post date: [July 24, 2026, 11:06pm UTC](https://discourse.cmake.org/t/findwxwidgets-cmake-on-windows-on-arm-support-is-broken/15760/1 "2026-07-24T23:06:16Z")

</div>

wxWidgets installs the librarys with arm64 suffix when build for WoA. This was done in [Building wxWidgets using CMAKE for ARM64 MSW, it generates the wrong lib folder name · Issue #23347 · wxWidgets/wxWidgets · GitHub](https://github.com/wxWidgets/wxWidgets/issues/23347)

However FindwxWidgets.cmake still uses

```auto
      if(CMAKE_SIZEOF_VOID_P EQUAL 8)
        set(_WX_ARCH _x64)
      endif()

```

which causes it unable to find the library when using find\_package(wxWidgets) on WoA.

I think this should be updated to use `CMAKE_GENERATOR_PLATFORM` like [Fix MSW lib names for ARM64 with CMake build · vadz/wxWidgets@77db8b7 · GitHub](https://github.com/vadz/wxWidgets/commit/77db8b7d5482807eaa8a3cb278c18bcfc03374d6) did.

Thanks.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [July 27, 2026, 1:12pm UTC](https://discourse.cmake.org/t/findwxwidgets-cmake-on-windows-on-arm-support-is-broken/15760/2 "2026-07-27T13:12:15Z")

</div>

[`CMAKE_GENERATOR_PLATFORM`](https://cmake.org/cmake/help/v4.4/variable/CMAKE_GENERATOR_PLATFORM.html) is not the right way to detect this. It’s an _input_ that may or may not be set by the user, and it’s generator-specific. For Visual Studio generators only, the actual target platform is in [`CMAKE_VS_PLATFORM_NAME`](https://cmake.org/cmake/help/v4.4/variable/CMAKE_VS_PLATFORM_NAME.html).

[`CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID`](https://cmake.org/cmake/help/v4.4/variable/CMAKE_LANG_COMPILER_ARCHITECTURE_ID.html) is more generally available and should be used instead. I’d welcome a merge request to start using it in FindwxWidgets.

---

<div class="post-metadata">

### Author: ![Noisyfox](https://discourse.cmake.org/user_avatar/discourse.cmake.org/noisyfox/32/6191_2.png) [@Noisyfox](https://discourse.cmake.org/u/Noisyfox)
#### Post date: [July 27, 2026, 2:13pm UTC](https://discourse.cmake.org/t/findwxwidgets-cmake-on-windows-on-arm-support-is-broken/15760/3 "2026-07-27T14:13:16Z")

</div>

> [@brad.king](#):
>
> For Visual Studio generators only, the actual target platform is in [`CMAKE_VS_PLATFORM_NAME`](https://cmake.org/cmake/help/v4.4/variable/CMAKE_VS_PLATFORM_NAME.html).

Ah you’re right. I missed that one when reading wxWidgets’ commit.

> [@brad.king](#):
>
> It’s an _input_ that may or may not be set by the user, and it’s generator-specific.

I guess that’s why wxWidgets checks this variable first, then fallback to `CMAKE_VS_PLATFORM_NAME` if not present? Is that the right approach so that cross-compile could work? Or maybe for some other reason? Sorry I’m still quite new to cmake.
