Skip to content

Prevent CMake Error on Custom Python Builds #1986

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

Merged
merged 1 commit into from
Nov 14, 2019

Conversation

mattdawkins
Copy link
Contributor

Without this change, on custom python builds (for example, the debug CPython build I just did on windows) the sys.prefix variable can sometimes be empty in the above python call, leading to only 5 arguments being passed into the cmake regex call here, result in a cmake configure time error. Adding quotes ensures 6 arguments are passed in.

@mattdawkins
Copy link
Contributor Author

CMake Error at tools/FindPythonLibsNew.cmake:137 (string):
  string sub-command REGEX, mode REPLACE needs at least 6 arguments total to
  command.
Call Stack (most recent call first):
  tools/pybind11Tools.cmake:16 (find_package)
  CMakeLists.txt:33 (include)

@wjakob
Copy link
Member

wjakob commented Nov 14, 2019

LGTM, thanks!

@wjakob wjakob merged commit 6f11347 into pybind:master Nov 14, 2019
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

Successfully merging this pull request may close these issues.

2 participants