Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
6697f80f
Commit
6697f80f
authored
Aug 08, 2016
by
Wenzel Jakob
Committed by
GitHub
Aug 08, 2016
Browse files
Merge pull request #325 from Hubble1942/fix-python-library-path-in-windows-venv
Fixed finding python libraries on windows in venv
parents
72270777
b81c500c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
tools/FindPythonLibsNew.cmake
tools/FindPythonLibsNew.cmake
+14
-0
No files found.
tools/FindPythonLibsNew.cmake
View file @
6697f80f
...
...
@@ -142,6 +142,20 @@ endif()
if
(
CMAKE_HOST_WIN32
)
set
(
PYTHON_LIBRARY
"
${
PYTHON_PREFIX
}
/libs/Python
${
PYTHON_LIBRARY_SUFFIX
}
.lib"
)
# when run in a venv, PYTHON_PREFIX points to it. But the libraries remain in the
# original python installation. They may be found relative to PYTHON_INCLUDE_DIR.
if
(
NOT EXISTS
"
${
PYTHON_LIBRARY
}
"
)
get_filename_component
(
_PYTHON_ROOT
${
PYTHON_INCLUDE_DIR
}
DIRECTORY
)
set
(
PYTHON_LIBRARY
"
${
_PYTHON_ROOT
}
/libs/Python
${
PYTHON_LIBRARY_SUFFIX
}
.lib"
)
endif
()
# raise an error if the python libs are still not found.
if
(
NOT EXISTS
"
${
PYTHON_LIBRARY
}
"
)
message
(
FATAL_ERROR
"Python libraries not found"
)
endif
()
elseif
(
APPLE
)
set
(
PYTHON_LIBRARY
"
${
PYTHON_PREFIX
}
/lib/libpython
${
PYTHON_LIBRARY_SUFFIX
}
.dylib"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment