mxcl/homebrew — Issue #10393: CMake Find(python) - wrong includes
Author: 2bits
Created: 2012-02-22 06:27:03+00:00
State: open

I'm writing a few new formula. I have Homebrew's python-2.7.2 installed
and in my PATH and PYTHONPATH before the system python.

CMake finds the right libs and binary, but the wrong includes directory:

-- Found PythonLibs: /usr/local/lib/libpython2.7.dylib (Required is at least version "2.6")
-- Boost version: 1.48.0
-- Found the following Boost libraries:
-- python
-- Python found TRUE
-- Python include dirs /System/Library/Frameworks/Python.framework/Headers
-- Python libraries /usr/local/lib/libpython2.7.dylib
-- Create version.h from version.h.in
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.2")

$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/local/share/python:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin

$ echo $PYTHONPATH
/usr/local/lib/python2.7/site-packages:

Is this expected behavior? I know I can pass it something like this if I want to, but still:

args << "-DPYTHON_INCLUDE_DIR=#{py27.include}" if py27.installed?