FindMatlab does not work with MCR
When trying to compile a mex file with only an MCR installed, matlab_add_mex complains about the engine libraries not being available. The MCR does not include engine libraries, so it fails. You don't need the engine libraries to generate mex files, so including the engine libraries should be optional. I have a suggested patch that only includes the libraries if they could be found. It fixes the issue for me.
The attached files should reproduce the problem (uses windows and MCR 9.5) build.cmd
Suggested patch: matlab_exclude_engine_lib.patch