FindMatlab: Refactor Matlab root list append operation

This commit is contained in:
Hermann von Kleist 2024-01-24 09:29:58 +01:00
parent 07256587f1
commit 37723c4bee

View File

@ -551,10 +551,9 @@ function(matlab_get_all_valid_matlab_roots_from_registry matlab_versions matlab_
if(IS_DIRECTORY "${current_MATLAB_ROOT}")
_Matlab_VersionInfoXML("${current_MATLAB_ROOT}" _matlab_version_tmp)
if("${_matlab_version_tmp}" STREQUAL "unknown")
list(APPEND _matlab_roots_list "MATLAB" ${_matlab_current_version} ${current_MATLAB_ROOT})
else()
list(APPEND _matlab_roots_list "MATLAB" ${_matlab_version_tmp} ${current_MATLAB_ROOT})
set(_matlab_version_tmp ${_matlab_current_version})
endif()
list(APPEND _matlab_roots_list "MATLAB" ${_matlab_version_tmp} ${current_MATLAB_ROOT})
endif()
endforeach()
@ -574,10 +573,9 @@ function(matlab_get_all_valid_matlab_roots_from_registry matlab_versions matlab_
if(IS_DIRECTORY "${current_MATLAB_ROOT}")
_Matlab_VersionInfoXML("${current_MATLAB_ROOT}" _matlab_version_tmp)
if("${_matlab_version_tmp}" STREQUAL "unknown")
list(APPEND _matlab_roots_list "MCR" ${_matlab_current_version} "${current_MATLAB_ROOT}/v${_matlab_current_version_without_dot}")
else()
list(APPEND _matlab_roots_list "MCR" ${_matlab_version_tmp} "${current_MATLAB_ROOT}/v${_matlab_current_version_without_dot}")
set(_matlab_version_tmp ${_matlab_current_version})
endif()
list(APPEND _matlab_roots_list "MCR" ${_matlab_version_tmp} "${current_MATLAB_ROOT}/v${_matlab_current_version_without_dot}")
endif()
endforeach()
endforeach()