summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Hirsch <scivision@users.noreply.gitlab.kitware.com>2022-08-31 23:03:29 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-01 14:35:41 (GMT)
commitba74c58ca45071178b37f24f254039ea53c56cdc (patch)
tree0fb9e9b3508e32424cf293d396f6686d90830abf
parentf7fc864c3ae26afa1ec8670699782e3da037a1d9 (diff)
downloadCMake-ba74c58ca45071178b37f24f254039ea53c56cdc.zip
CMake-ba74c58ca45071178b37f24f254039ea53c56cdc.tar.gz
CMake-ba74c58ca45071178b37f24f254039ea53c56cdc.tar.bz2
FindMatlab: add'l check that Matlab test version file exists
this last resort check is for some HPC with "module load matlab" not enacted that fail to catch in earlier checks. That would error CMake configure even if find_package(Matlab) is not REQUIRED
-rw-r--r--Modules/FindMatlab.cmake9
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 48ef5eb..1d88985 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -843,6 +843,15 @@ function(matlab_get_version_from_matlab_run matlab_binary_program matlab_list_ve
endif()
endif()
+ if(NOT EXISTS "${_matlab_temporary_folder}/matlabVersionLog.cmaketmp")
+ # last resort check as some HPC with "module load matlab" not enacted fail to catch in earlier checks
+ # and error CMake configure even if find_package(Matlab) is not REQUIRED
+ if(MATLAB_FIND_DEBUG)
+ message(WARNING "[MATLAB] Unable to determine the version of Matlab. The version log file does not exist.")
+ endif()
+ return()
+ endif()
+
# if successful, read back the log
file(READ "${_matlab_temporary_folder}/matlabVersionLog.cmaketmp" _matlab_version_from_cmd)
file(REMOVE "${_matlab_temporary_folder}/matlabVersionLog.cmaketmp")