-
Notifications
You must be signed in to change notification settings - Fork 2k
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
FindNewPython's forces check against PYTHON_EXECUTABLE during configuration phase #236
Comments
Since this is a fairly specialized use case, I wonder if you could you propose a small change to the build system that will accomplish this? |
What's the actual build error that results from this? I'm wondering if the failure point is in |
During
|
Ah, I see now. And I guess the easiest fix would be as you suggested: to skip the function in case the variables are already defined. The only issue is that |
I technically could do the above if it was a must, but its an inconvenience unless pybind11 really requires it being there as a dependency. @dean0x7d I am going to follow up your reply @#236 (comment) next. |
For a concrete fix, I propose adding the following to the top of if(PYTHONLIBS_FOUND)
return()
endif() So if the user supplies |
As for |
@dean0x7d I am trying your suggestion in #236 (comment) and will reply shortly. |
|
I can confirm that the solution you suggested at #236 (comment) works. I was able to test it with (
|
@tony Good to hear that it works. |
Skip FindPythonLibsNew if PYTHONLIBS_FOUND is defined (fix #236)
or local. Still issue pybind/pybind11#236
or local. Still issue pybind/pybind11#236
A recent change to pybind11 does checks against a python interpreter. The verification done for FindPythonLibs doesn’t apply in the case of superbuilt python (ExternalProject_Add) since the PYTHON_EXECUTABLE isn't ready until compile time.
In my circumstances, I already have
${PYTHON_LIBRARY}
and${PYTHON_INCLUDE_DIR}
set. CMake's FindPythonLibs allows you to specify your versions:Expected behavior:
FindPythonLibsNew.cmake
should skipexecute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
and/or fallback tofind_package(PythonLibs)
behavior ifPYTHON_LIBRARY
andPYTHON_INCLUDE_DIR
is already set.The text was updated successfully, but these errors were encountered: