summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-16 16:10:17 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-01-16 16:10:29 (GMT)
commit320d6f446dc0232db6af81de067a8750a57b51a8 (patch)
tree5055fab53a43ff2c4b414633a7c7a186149cf6fd /Modules
parentfc2590e9e74ffdc7d758b96704df193726262518 (diff)
parent694727bb45eaf639296fd1c93d1d4747236ad5c2 (diff)
downloadCMake-320d6f446dc0232db6af81de067a8750a57b51a8.zip
CMake-320d6f446dc0232db6af81de067a8750a57b51a8.tar.gz
CMake-320d6f446dc0232db6af81de067a8750a57b51a8.tar.bz2
Merge topic 'FindMatlab-fix-version-without-versioninfoxml'
694727bb45 FindMatlab: Restore support for versions without VersionInfo.xml Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9151
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindMatlab.cmake25
1 files changed, 13 insertions, 12 deletions
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index b90a45f..c5379d5 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -503,6 +503,8 @@ function(matlab_extract_all_installed_versions_from_registry win64 matlab_versio
_Matlab_VersionInfoXML("${_reg}" _matlab_version_tmp)
if(NOT "${_matlab_version_tmp}" STREQUAL "unknown")
list(APPEND matlabs_from_registry ${_matlab_version_tmp})
+ else()
+ list(APPEND matlabs_from_registry ${match})
endif()
endforeach()
@@ -1409,21 +1411,20 @@ function(_Matlab_VersionInfoXML matlab_root _version)
set(_ver "unknown")
set(_XMLfile ${matlab_root}/VersionInfo.xml)
- if(NOT EXISTS ${_XMLfile})
- return()
- endif()
+ if(EXISTS ${_XMLfile})
- file(READ ${_XMLfile} versioninfo_string)
+ file(READ ${_XMLfile} versioninfo_string)
- if(versioninfo_string)
- # parses "<version>23.2.0.2365128</version>"
- string(REGEX MATCH "<version>([0-9]+(\\.[0-9]+)+)</version>"
- version_reg_match
- ${versioninfo_string}
- )
+ if(versioninfo_string)
+ # parses "<version>23.2.0.2365128</version>"
+ string(REGEX MATCH "<version>([0-9]+(\\.[0-9]+)+)</version>"
+ version_reg_match
+ ${versioninfo_string}
+ )
- if(CMAKE_MATCH_1)
- set(_ver "${CMAKE_MATCH_1}")
+ if(CMAKE_MATCH_1)
+ set(_ver "${CMAKE_MATCH_1}")
+ endif()
endif()
endif()