[suggestion] FindPython version hint
Currently, FindPython uses Python_EXECUTABLE
as a hint for which Python to find if you set it when you first run. However, it does not do the same with Python_VERSION
, but it seems like it could. Basically, it would enable something like this:
cmake -S . -B build36 -DPYBIND11_FINDPYTHON=ON -DPython_VERSION=3.6
cmake -S . -B build38 -DPYBIND11_FINDPYTHON=ON -DPython_VERSION=3.8
This used to be available in a slightly different form with Python_ADDITIONAL_VERSIONS
(regardless of the odd capitalization, it was part of FindPythonInterp). I personally don't like searching by version, and would use a venv or Python_EXECUTABLE
, but I can see where some people might like it and used it before.
Feel free to close if it doesn't sound like a good idea.
Edited by Henry Schreiner