-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the added warning, I'm fine with this. Thanks @henryiii
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.