this one is actually mex code, so should use add_mex instead of add_library.  (and we should fix the add_mex code)