fix: respect PYTHON_VERSION if set in classic mode#2414
Conversation
|
Why don't we also show a warning in the branch where we allow the old variable? |
|
You mean a warning if |
|
The other way around. The "legacy" way of doing things is using |
|
That's what I suggest at the top ("We could add a warning or error instead"). The old way of doing things is with With FindPython, there is no version-based search variable that is available like this (though I'm discussing it in an issue). find_package(Python EXACT 3.7 ...)(But I'm arguing this can't be done from the command line, and is rather a package requirement). |
Oh, thanks for clarifying!
Right. Any reason not to? |
YannickJadoul
left a comment
There was a problem hiding this comment.
Looks good, yes. More of a fix/convenience, indeed, so do merge when you're happy with it, AFAIC!
If PYBIND11_PYTHON_VERSION is not set, but PYTHON_VERSION is, on the first run, use that for the hint. We could add a warning or error instead - but the current behavior is a bit odd and unhelpful.