CMAKE_GENERATOR_PLATFORM 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.
CMAKE_<LANG>_COMPILER_ARCHITECTURE_ID is more generally available and should be used instead. I’d welcome a merge request to start using it in FindwxWidgets.
Ah you’re right. I missed that one when reading wxWidgets’ commit.
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.