-
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
[Feature request] Export cmake variables corresponding to Python version #2268
Comments
Possibly will be solved as part of #2201. |
Actually this doesn't mean you can't use them downstream, it just means you shouldn't change them in a configure call (they don't show up in things like |
@SylvainCorlay Unless you have a specific request, I think this should be closed, let me know if there's anything else. In "classic" mode, the variables are exposed; CMake's find_package(Python COMPONENTS Interpreter Development)
# All Python variables from FindPython usable
find_package(pybind11) |
@henryiii I don't think this should be marked as closed. Our use case is that we rely on Pybind11 to find Python and export the cmake flags for downstream packages. In these downstream packages, we need to do different things depending on the Python version. Should we make our own call to Hence I think that pybind11 should not make these INTERNAL. |
I still believe the correct setting for this may be "INTERNAL". INTERNAL in CMake means it is not user visible, that is, it is not something you set in the command line, ie, The other possible settings are:
Also, the best solution is likely to use: find_package(Python COMPONENTS Interpreter Development)
message(STATUS "${Python_VERSION}")
...
add_subdirectory(pybind11) # Respects previous call to find_package(Python, does not find or set old variables |
To reiterate, the following usage is fully supported: add_subdirectory(pybind11)
message(STATUS "${PYTHON_VERSION}") Marking |
PS: Changed |
In CMake-GUI:
That's the meaning of this setting; it's a GUI setting. |
Hum, patching the pybind11 to remove the INTERNAL appears to work for us. Will get back with some more info. |
Variables such as
PYTHON_VERSION_MAJOR
andPYTHON_VERSION_MINOR
are marked asINTERNAL
.As a consequence, downstream projects making use of pybind11 in their cmake cannot make use of these variables. It would be very convenient to have access to them!
The text was updated successfully, but these errors were encountered: