CMake has a much improved way to find the Python interpreter and libraries which guarantees that the interpreter and libraries are the same. However, this functionality is only available in CMake 3.12 and later. This patch changes the CMake logic to use that without bumping the minimum CMake version.
Question for people familiar with CMake on Windows: do you think that FindPython could replace the current logic in find_python_libs_windows? So we could do something like:
if(NOT CMAKE_VERSION VERSION_LESS "3.12") # Use FindPython else() if (Windows) # use find_python_libs_windows else() # use PythonInterp / PythonLibs endif() endif()