diff options
author | Brad King <brad.king@kitware.com> | 2017-09-26 16:56:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-09-27 10:56:10 (GMT) |
commit | a245f850bc4f4f209e759b6eab5b48c0693e38af (patch) | |
tree | 0760c7a258ba62c25d844c299b3139a5cbd2c9d9 /Modules/FindMatlab.cmake | |
parent | c40d130034278e28964929e8d61f3280945b7531 (diff) | |
download | CMake-a245f850bc4f4f209e759b6eab5b48c0693e38af.zip CMake-a245f850bc4f4f209e759b6eab5b48c0693e38af.tar.gz CMake-a245f850bc4f4f209e759b6eab5b48c0693e38af.tar.bz2 |
FindMatlab: Fix extraction of quoted version number
The version string in recent Matlab versions has changed.
Now the version number is inside two `'`.
Patch-by: nama on gitlab.kitware.com
Fixes: #17308
Diffstat (limited to 'Modules/FindMatlab.cmake')
-rw-r--r-- | Modules/FindMatlab.cmake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 7493281..d287688 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -681,12 +681,12 @@ function(matlab_get_version_from_matlab_run matlab_binary_program matlab_list_ve string(SUBSTRING ${_matlab_version_from_cmd} ${index} -1 substring_ans) string( - REGEX MATCHALL "ans[\r\n\t ]*=[\r\n\t ]*([0-9]+(\\.[0-9]+)?)" + REGEX MATCHALL "ans[\r\n\t ]*=[\r\n\t ]*'?([0-9]+(\\.[0-9]+)?)" matlab_versions_regex ${substring_ans}) foreach(match IN LISTS matlab_versions_regex) string( - REGEX MATCH "ans[\r\n\t ]*=[\r\n\t ]*(([0-9]+)(\\.([0-9]+))?)" + REGEX MATCH "ans[\r\n\t ]*=[\r\n\t ]*'?(([0-9]+)(\\.([0-9]+))?)" current_match ${match}) list(APPEND matlab_list_of_all_versions_tmp ${CMAKE_MATCH_1}) |