Skip to content

FindMatlab: Sort available Matlab versions using natural comparison.

On Windows, when FindMatlab.cmake searches the registry for installed Matlab versions, it sorts these versions alphabetically. Since Matlab 2021a (version 9.10) came out this became a problem as now version 9.10 is placed after 9.1 instead of after a higher version less than 9.10. The result is that FindMatlab doesn't return the highest version by default. This fix uses the natural sort comparison which was introduced in CMake 3.18.

Merge request reports