The source project of this merge request has been removed.
FindMatlab: Add fallback to use -batch option in version extraction and matlab_add_unit_test
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
inmatlab_add_unit_test
if MATLAB >= R2019a .
Fixes: #22646 (closed)
Topic-rename: FindMatlab-batch
Edited by Brad King