[Cmake-commits] CMake branch, master, updated. v3.12.1-493-gca7507c

Kitware Robot kwrobot at kitware.com
Tue Aug 28 13:55:03 EDT 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  ca7507cebc74fe4af3660cf85c72070c3f95a9ba (commit)
       via  7d9640dbc262c86a0fa6b9a437ba418a006e93b7 (commit)
      from  9da844d8cbbd2c525265a551421dbf126ef328d1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca7507cebc74fe4af3660cf85c72070c3f95a9ba
commit ca7507cebc74fe4af3660cf85c72070c3f95a9ba
Merge: 9da844d 7d9640d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Aug 28 17:52:12 2018 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Aug 28 13:52:17 2018 -0400

    Merge topic 'FindMatlab-missing-install'
    
    7d9640dbc2 FindMatlab: Guard against nonexistent installation
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !2318


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7d9640dbc262c86a0fa6b9a437ba418a006e93b7
commit 7d9640dbc262c86a0fa6b9a437ba418a006e93b7
Author:     Chuck Atkins <chuck.atkins at kitware.com>
AuthorDate: Mon Aug 27 14:57:17 2018 -0400
Commit:     Chuck Atkins <chuck.atkins at kitware.com>
CommitDate: Mon Aug 27 14:57:17 2018 -0400

    FindMatlab: Guard against nonexistent installation

diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 9e13fc3..f2ada3b 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -1167,21 +1167,24 @@ function(_Matlab_get_version_from_root matlab_root matlab_or_mcr matlab_known_ve
 
     # return the updated value
     set(${matlab_final_version} ${Matlab_VERSION_STRING_INTERNAL} PARENT_SCOPE)
-  else()
+  elseif(EXISTS "${matlab_root}/VersionInfo.xml")
     # MCR
     # we cannot run anything in order to extract the version. We assume that the file
     # VersionInfo.xml exists under the MatlabRoot, we look for it and extract the version from there
     set(_matlab_version_tmp "unknown")
     file(STRINGS "${matlab_root}/VersionInfo.xml" versioninfo_string NEWLINE_CONSUME)
-    # parses "<version>9.2.0.538062</version>"
-    string(REGEX MATCH "<version>(.*)</version>"
-           version_reg_match
-           ${versioninfo_string}
-          )
-
-    if(NOT "${version_reg_match}" STREQUAL "")
-      if("${CMAKE_MATCH_1}" MATCHES "(([0-9])\\.([0-9]))[\\.0-9]*")
-        set(_matlab_version_tmp "${CMAKE_MATCH_1}")
+
+    if(versioninfo_string)
+      # parses "<version>9.2.0.538062</version>"
+      string(REGEX MATCH "<version>(.*)</version>"
+             version_reg_match
+             ${versioninfo_string}
+            )
+
+      if(NOT "${version_reg_match}" STREQUAL "")
+        if("${CMAKE_MATCH_1}" MATCHES "(([0-9])\\.([0-9]))[\\.0-9]*")
+          set(_matlab_version_tmp "${CMAKE_MATCH_1}")
+        endif()
       endif()
     endif()
     set(${matlab_final_version} "${_matlab_version_tmp}" PARENT_SCOPE)
@@ -1189,8 +1192,7 @@ function(_Matlab_get_version_from_root matlab_root matlab_or_mcr matlab_known_ve
         "${_matlab_version_tmp}"
         CACHE INTERNAL "Matlab (MCR) version (automatically determined)"
         FORCE)
-
-    endif() # Matlab or MCR
+  endif() # Matlab or MCR
 
 endfunction()
 

-----------------------------------------------------------------------

Summary of changes:
 Modules/FindMatlab.cmake | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list