python: finding specific library version via CMake

René J.V. Bertin rjvbertin at gmail.com
Mon Jun 22 14:01:25 PDT 2015


Hi,

I have a CMake file that has the following, hopefully self-explanatory, bit:

{{{
find_package(PythonLibs 3.4.3 REQUIRED)
if ( NOT ${PYTHONLIBS_FOUND} OR ${PYTHON_VERSION_MINOR} GREATER 4 )
    message(FATAL_ERROR "Python 3.4.3 with --enable-shared is required")
endif()
}}}

The only thing that did was picking up an old 2.4.3 (!) framework I'd installed as /Library/Frameworks/Python2.4.framework; after removing that it finds nothing at all.
I had a comparable issue with `find_package(PythonInterp 3.0 required)` which I could resolve by hardcoding the PYTHON_EXECUTABLE variable, but I don't think one can pull a similar trick with the PythonLibs script.

Is there a clean way out, I'm surely not the first one to try this?

Thanks,
R.


More information about the macports-dev mailing list