matlab-only way to get the cmake params, should be more robust

hopefully will help to resolve #236 .