[CMake] PythonInterp and PythonLibs find different versions on Apple

Burlen Loring burlen.loring at gmail.com
Wed Dec 23 11:54:21 EST 2015


Hi,

I'm having this issue that cmake using version 3.3.0. Python detection 
is finding different versions of interpreter and libraries. There are 
two version of Python installed, system one and homebrew one. cmake 
finds Interpreter from homebrew while libs are from system install.

Here's my CmakeLists

    find_package(PythonInterp)
    find_package(PythonLibs)

and configure output

    -- Found PythonInterp: /usr/local/bin/python (found version "2.7.11")
    -- Found PythonLibs: /usr/lib/libpython2.7.dylib (found version
    "2.7.10")

I also tried

    find_package(PythonInterp)
    find_package(PythonLibs ${PYTHON_VERSION_STRING})

but got

    -- Found PythonInterp: /usr/local/bin/python (found version "2.7.11")
    -- Could NOT find PythonLibs: Found unsuitable version "2.7.10", but
    required is at least "2.7.11" (found /usr/lib/libpython2.7.dylib)

I suppose I can just over ride these manually, but shouldn't this just 
work? or am I doing it wrong?

Burlen

ps.

I tried to install cmake 3.4 on my system but bootstrap has a compile error.

I observed the same with cmake 3.4.1 on a colleagues Apple system that 
has system Python plus Annaconda Python. This leads me to think that 
it's not addressed in 3.4.1.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151223/2e5d9658/attachment-0001.html>


More information about the CMake mailing list