Cannot read 64-bit Windows Registry keys while cross-compiling for 32-bit
When cross-compiling for 32-bit platforms on 64-bit Windows, sometimes toolchain components need to be located using Windows registry keys (e.g. using get_filename_component() and find_path(), etc.).
However, CMake uses the target-platform bitness, not the host platform bitness, to determine whether to fetch 64-bit or 32-bit registry values, which means that it only looks at the 32-bit registry keys, which is incorrect in this situation.
There are reasons why a single project might want to query both 32-bit and 64-bit registry keys (e.g. some tools are only available as 32-bit or 64-bit programs), so the best solution may be to allow the registry view to be specified in the path, e.g. [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.9\InstallPath;ExecutablePath;64] to get a path for a 64-bit Python install, or [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.9\InstallPath;ExecutablePath;32] to get a path for a 32-bit Python install.