py2.7-config usage

Mark Brethen mark.brethen at gmail.com
Fri Jul 4 16:01:10 PDT 2014


On Jul 4, 2014, at 5:33 PM, Joshua Root <jmr at macports.org> wrote:

> On 2014-7-5 07:45 , Mark Brethen wrote:
>> How do I use python-config (or python2.7-config) to assign FreeCAD's config options: -DPYTHON_LIBRARY and -DPYTHON_INCLUDE_DIR? I've tried this:
>> 
>> python_prefix = '${prefix}/bin/python2.7-config --prefix}'.strip
>> python_library = "${python_prefix}/Python"
>> python_include_dir = "${python_prefix}/Headers"
>> 
>> configure.args-append   -DFREECAD_BUILD_ROBOT=OFF \
>>    -DPYTHON_LIBRARY=${python_library} \
>>    -DPYTHON_INCLUDE_DIR=${python_include_dir}  \
>> 
>> but it gives an error.
> 
> You appear to be trying to use some sort of Tcl/python hybrid syntax?
> 
> It would be best if the cmake files ran python2.7-config, but you can do
> this:
> 
> pre-configure {
> 	set python_prefix [exec ${prefix}/bin/python2.7-config --prefix]
> 	configure.args-append  -DPYTHON_LIBRARY=${python_prefix}/Python \
> 		-DPYTHON_INCLUDE_DIR=${python_prefix}/Headers
> }
> 
> - Josh

That works, however: 

:info:configure -- Found PythonInterp: /usr/bin/python (found version "2.7.5") 
:info:configure -- Could NOT find PythonLibs: Found unsuitable version "2.7.8", but required is exact version "2.7.5" (found /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python)
:info:configure Python not found, install python!

There is a mismatch in versions as it's using the system installed python for PythonInterp. Do I have to enable this in the macports install?

Mark






More information about the macports-dev mailing list