1. Michael Forbes
  2. swig_cpp_python

Source

swig_cpp_python / setup.py

from distribute_setup import use_setuptools
use_setuptools()

import numpy as np

dependencies = []

if __name__ == "__main__":
    from setuptools import setup, Extension
    from ez_setup import use_setuptools
    use_setuptools()

A_module = Extension(
    'mod.swig._A',
    sources=['_generated/A_wrap.cpp'],
    #swig_opts=['-c++', '-I', 'src', '-outdir', 'mod'],
    libraries = ['lapack', 'armadillo'],
    include_dirs=['src', np.get_include()],
    )

C_module = Extension(
    'mod.swig._C',
    sources=['_generated/C_wrap.cpp'],
    #swig_opts=['-c++', '-I', 'src', '-outdir', 'mod'],
    libraries = [],
    include_dirs=['src', np.get_include()],
    )

setup (name        = 'mod',
       version     = '0.1',
       author      = "Michael McNeil Forbes",
       description = "Example of a C++ class to python module.",
       ext_modules = [A_module, C_module],
       packages    = ["mod", "mod.swig"],
       package_dir = {'mod.swig': '_generated/py'},
       )