summaryrefslogtreecommitdiffstats
path: root/Modules/FindMatlab.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-01-26 15:09:42 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-01-26 15:10:02 (GMT)
commitebef793519a7c7b6e9968a7000be6b50755e3b11 (patch)
treec3cf1b27f63f7ded1b7b734e255abf3d0e8548be /Modules/FindMatlab.cmake
parent60f9b0fd99c76623815ed33407f3a5694273662a (diff)
parentb1e27b1b9dc13b22e74f36884e748699f8bcb322 (diff)
downloadCMake-ebef793519a7c7b6e9968a7000be6b50755e3b11.zip
CMake-ebef793519a7c7b6e9968a7000be6b50755e3b11.tar.gz
CMake-ebef793519a7c7b6e9968a7000be6b50755e3b11.tar.bz2
Merge topic 'find-matlab-fix-nonzero-patch-version'
b1e27b1b9d FindMatlab: Some versions use major.minor.patch in the registry Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9183
Diffstat (limited to 'Modules/FindMatlab.cmake')
-rw-r--r--Modules/FindMatlab.cmake9
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 5259a40..7777643 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -471,10 +471,10 @@ function(matlab_extract_all_installed_versions_from_registry win64 matlab_versio
)
if(_reg)
- string(REGEX MATCHALL "([0-9]+\\.[0-9]+)" _versions_regex "${_reg}")
+ string(REGEX MATCHALL "([0-9]+(\\.[0-9]+)+)" _versions_regex "${_reg}")
foreach(_match IN LISTS _versions_regex)
- if(_match MATCHES "([0-9]+\\.[0-9]+)")
+ if(_match MATCHES "([0-9]+(\\.[0-9]+)+)")
cmake_host_system_information(RESULT _reg
QUERY WINDOWS_REGISTRY "HKLM/SOFTWARE/Mathworks/${_installation_type}/${CMAKE_MATCH_1}"
VALUE "MATLABROOT"
@@ -542,8 +542,9 @@ function(matlab_get_all_valid_matlab_roots_from_registry matlab_versions matlab_
# extract_matlab_versions_from_registry_brute_force or
# matlab_extract_all_installed_versions_from_registry.
- # only the major.minor version is used in Mathworks Windows Registry keys
- list(TRANSFORM matlab_versions REPLACE "^([0-9]+\\.[0-9]+).*" "\\1")
+ # Mostly the major.minor version is used in Mathworks Windows Registry keys.
+ # If the patch is not zero, major.minor.patch is used.
+ list(TRANSFORM matlab_versions REPLACE "^([0-9]+\\.[0-9]+(\\.[1-9][0-9]*)?).*" "\\1")
set(_matlab_roots_list )
# check for Matlab installations