Running swigmatlabplus from inside Visual Studio

 

This is very easy to do. Just add your swig.i file to your project -- it will show up under "Resource Files" for your project in the fIle view.

Go the settings box for your project (Alt-F7) and click on the swig.i file. Now click on the "Custom Build" tab (shown).

In the "Commands" Section, enter:

swigmatlabplus -Ic:\src\swigmatlabplus -c++ -o $(ProjDir)/$(InputName)_wrap.cpp $(InputPath)

In the "Outputs" Section, enter:

$(ProjDir)/$(InputName)_wrap.cpp

Now compile swig.i (Ctrl-F7) and add swig_wrap.cpp to your project. After this, you can just use F7 to build your entire project, swig_wrap and all!