-
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
CMake 3.12+ Python Find Routines, IPO/LTO #2201
Comments
This is also helpful for those using Pyenv, the old find module doesn't detect the active python version but rather the newest one. The new version does correctly identify the active version . |
I highly recommend supporting this (and will try to help tackle this in the near future), but even if we jump to supporting 3.12+ only tomorrow, I think we will need to support both methods for a long time. If a package using PyBind11 does anything else with CMake + Python, either another package or even just using the variables they expect to be defined, they will probably have to update to the new module as well (unless they mix better than I think they do). Quickly thinking about it, I would have a Another option would be to simply respect an existing find package run - so if you do: find_package(Python COMPONENTS Development)
find_package(pybind11) then it picks up the discovered new-style Python instead of self discovering with the old mechanism. That might be the best way, actually. I haven't used the new module much yet, since basically whenever I need Python + CMake, it's probably for a PyBind11 module. :) |
To expand upon @henryiii 's point: The new |
Dup of #2139, by the way. |
CMake 3.12.0+ deprecates the old find modules for Python and unifies them into a new call find module:
We should consider mid to long-term to update our CMake scripts accordingly, as soon as we can require CMake 3.12+ (released July 2018).
Furthermore, CMake 3.9.0+ introduces an abstraction for IPO/LTO, which can simplify our code base.
The text was updated successfully, but these errors were encountered: