Skip to content

FindMatlab: Add fallback to use -batch option in version extraction and matlab_add_unit_test

Silvio Traversaro requested to merge (removed):fix22646 into master

Since MATLAB R2019a the -r option used by FindMatlab module to execute MATLAB code in non-interactive mode is deprecated, and the new recommended way to run non-interactive code is the -batch option.

In some environments, for example MATLAB when is running on GitHub Actions (see https://github.com/matlab-actions/overview), the -r option is not working at all.

This PR fixes this issue by:

  • adding a -batch fallback if the -r option did not worked when detecting the version
  • switching to use -batch in matlab_add_unit_test if MATLAB >= R2019a .

Fixes: #22646 (closed)
Topic-rename: FindMatlab-batch

Edited by Brad King

Merge request reports