An update will be applied January 25th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

Commit 48b33b06 authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'FindMatlab-fix-empty-list-index'

29768b03 FindMatlab: Avoid indexing an empty list of versions
parents f76bcee9 29768b03
......@@ -1030,13 +1030,17 @@ function(_Matlab_get_version_from_root matlab_root matlab_known_version matlab_f
matlab_get_version_from_matlab_run("${Matlab_PROG_VERSION_STRING_AUTO_DETECT}" matlab_list_of_all_versions)
list(GET matlab_list_of_all_versions 0 _matlab_version_tmp)
list(LENGTH matlab_list_of_all_versions list_of_all_versions_length)
if(${list_of_all_versions_length} GREATER 0)
list(GET matlab_list_of_all_versions 0 _matlab_version_tmp)
set(_matlab_version_tmp "")
# set the version into the cache
set(Matlab_VERSION_STRING_INTERNAL ${_matlab_version_tmp} CACHE INTERNAL "Matlab version (automatically determined)" FORCE)
# warning, just in case several versions found (should not happen)
list(LENGTH matlab_list_of_all_versions list_of_all_versions_length)
if((${list_of_all_versions_length} GREATER 1) AND MATLAB_FIND_DEBUG)
message(WARNING "[MATLAB] Found several versions, taking the first one (versions found ${matlab_list_of_all_versions})")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment