I've run into an issue with the CMake setup for python-broccoli and
pysubnetree. The problem occurs on a machine that has Python 2.4
installed system-wide, but where I have installed a self-compiled 2.6
into my home. CMake does detect the 2.6 binary correctly (it's in the
PATH), but its PythonLibs still goes for the 2.4 libraries.
I think the underlying problem is that PythonLibs searches for the
libraries itself, while it should better ask the "python-config" that
corresponds to what PythonInterp found.
I'm attaching a patch that runs python-config and then adapts
CMAKE_LIBRARY_PATH accordingly before it does PythonLibs. Patching
both python-broccoli and pysubnettree with this solves my problem.
However, I'm not sure this is indeed the cleanest way of doing it.
I think the underlying problem is that PythonLibs searches for the
libraries itself, while it should better ask the "python-config" that
corresponds to what PythonInterp found.
I didn't look at the patch but I agree this is the right way to do this.
Seems like a good method to use (I didn't see any innate/obvious way to get FindPythonLibs.cmake to be aware of the result from FindPythonInterp.cmake).
The patch seems to add two "${PYTHON_PREFIX}/lib" paths, though, which I don't understand: