def sdl_get_version(): """ Returns the installed SDL library version. By default, we obtain the version using either 'pkgconfig' or the 'sdl-config' tool. """ if pkgconfig.has_pkgconfig (): return pkgconfig.get_version ("sdl")[0] elif libconfig.has_libconfig("sdl-config"): return libconfig.get_version("sdl-config")[0] # TODO: SDL may be installed manually (i.e. compiled from # source). any way to find the version? return None
def _configure_pkgconfig(self): """ Configuration callback using the 'pkgconfig' tool """ pkg = self.pkgconfig_name if (not pkg or not pkgconfig.has_pkgconfig() or not pkgconfig.exists(pkg)): return False self.incdirs += pkgconfig.get_incdirs(pkg) self.libdirs += pkgconfig.get_libdirs(pkg) self.libs += pkgconfig.get_libs(pkg) self.cflags += pkgconfig.get_cflags(pkg) self.lflags += pkgconfig.get_lflags(pkg) return True