FindPython3: picks standalone Python3 over Python3 installed by MinGW-w64.
cmake_minimum_required(VERSION 3.16)
project( bug_mingw_python3 C )
find_package( Python3 )
MinGW-w64 Shell:
$ echo $PATH
/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
$ cmake . -G"MSYS Makefiles"
-- The C compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/Programs/msys64/mingw64/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Python3: C:/Program Files/Python39/python.exe (found version "3.9.1") found components: Interpreter
-- Configuring done
-- Generating done
-- Build files have been written to: D:/dev/Bugs/FindPython_bug
It should pick the one installed by MinGW ( ../msys64/mingw64/bin/python.exe )
Edited by Brad King