I’m working on writing an internal library at work for accessing one of the (slightly crazy) file formats we work with here. It is being ported over to being GObject/GType aware (away from vanilla C) in order to make writing bindings to higher-level languages a little less painful.
The build system is based on CMake but the PyGTK FAQ entry on extending PyGTK (apparently one of the few up to date sources of information on writing GObject bindings) only has eyes for automake.
I’ve created a simple CMake module[1] which wraps up some of the nastier magic involved in writing bindings. Here is an example of it in use for the hypothetical libfoo.
# Attempt to find pygobject
find_package(PyGObject)
# Use CMake magic to find GLIB_... and GOBJECT_...
# (I would suggest pkg-config)
if(NOT PYGOBJECT_FOUND)
message(STATUS "PyGObject could not be found, Python bindings will not be built.")
else(NOT PYGOBJECT_FOUND)
pygobject_target_add_bindings(FOOBINDINGS foo
MODULEPREFIX foo
HEADERS path/to/libfoo/foo.h
OVERRIDE foo.override)
include_directories(
${GLIB_INCLUDE_DIRS} ${GOBJECT_INCLUDE_DIRS}
${FOOBINDINGS_INCLUDE_DIRS} ${PYGOBJECT_PYGTK_INCLUDE_DIRS})
add_library(foo MODULE foomodule.c ${FOOBINDINGS_SOURCES})
link_directories(
${GLIB_LIBRARY_DIRS} ${GOBJECT_LIBRARY_DIRS}
${FOOBINDINGS_LINK_DIRS})
target_link_libraries(foo libfoo ${SVFBINDINGS_LIBRARIES})
set_target_properties(foo PROPERTIES PREFIX "")
endif(NOT PYGOBJECT_FOUND)
[1] To the extent available under any applicable copyright laws, I release this into the public domain.

