Use String instead of char*
Use a different command to open matlab on osx
Fix RPATH warning on osx for cmake