Repository navigation
Improve case on Mac where cmake fails to find Python with the custom search path. - #49
Merged
Merged
Conversation
robertnishihara
force-pushed
the
findpython
branch
from
November 20, 2016 02:08
6019722 to
a57d355
Compare
…efault to using find_package.
robertnishihara
force-pushed
the
findpython
branch
from
November 20, 2016 02:16
a57d355 to
e385757
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CMake tries to find the Python libraries to use during compilation by searching near the Python executable. However, when the user is inside of a virtualenv, the executable is inside the virtual environment directory while the Python libraries are in their original location.
However, (in the cases I tested) we can still find the Python include directories without trouble, by running the following.
That gives us a hint about where the Python libraries are. So if we can't find the libraries near the executable, we look for them near the include directories.
This seems to address the virtualenv case (and hopefully most cases).