Skip to content

Do not overwrite Python_ADDITIONAL_VERSIONS #2128

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

Closed
Flamefire opened this issue Mar 4, 2020 · 1 comment
Closed

Do not overwrite Python_ADDITIONAL_VERSIONS #2128

Flamefire opened this issue Mar 4, 2020 · 1 comment

Comments

@Flamefire
Copy link
Contributor

Issue description

Currently the pybind11 CML sets Python_ADDITIONAL_VERSIONS no matter what. This leads to problems with the current (2.4.3) release when Python 3.8 is available next to some older Python. Normally a recentish CMake would find Python 3.8 just fine, but due to pybind11 setting Python_ADDITIONAL_VERSIONS to 3.7 ... it will search for 3.7 first (and finds the older version somewhere in the system)

A user could generically use cmake -DPython_ADDITIONAL_VERSIONS=3.8 ... to have any project search for this version first. But here pybind11 overwrites this so it has no effect.

Suggestion: Use list(APPEND Python_ADDITIONAL_VERSIONS 3.8 3.7 3.6 ...) This has been available since at least CMake 3.0 (can't find the docs for 2.8 easily but I'd recommend to switch to >=3.1 anyway. older ones have some weird behaviour corner cases)

@henryiii
Copy link
Collaborator

henryiii commented Aug 6, 2020

Fixed in #2338

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants