[CMake] python wrappers through xcode

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Jul 30 17:10:37 EDT 2008


Hi Tonio:

See CMakeLists.txt at
http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/bindings/python/ for
a working example of configuring a python interface to a C library with
swig and CMake.

The above works for at least Linux and Mac OS X.  I didn't look deeply at
your detailed example, but it looked like you were not setting some key
SWIG-related variables that we use above.  You can find the documentation of
those variables (e.g., CMAKE_SWIG_FLAGS, CMAKE_SWIG_OUTDIR,
SWIG_MODULE_<modulename>_EXTRA_DEPS, and the SWIG_MODULE_NAME property) in
the general CMake documentation you get with cmake --help-full.  Also, I
think your target_link_libraries command must refer to the C or C++ library
that SWIG is wrapping.  For example, we use

swig_link_libraries(plplotcmodule plplot${LIB_TAG} ${PYTHON_LIBRARIES})

where plplot${LIB_TAG} is the target name for the core C PLplot library
that is built by CMake.

I don't use XCODE (or Mac OS X for that matter), but I hope this help on the
fundamentals of Swig support in CMake gets rid of or at least reduces the
XCODE problems you are seeing.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list