py2.7-config usage

Joshua Root jmr at macports.org
Fri Jul 4 15:33:38 PDT 2014


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


More information about the macports-dev mailing list