summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Hirsch <scivision@users.noreply.github.com>2022-08-28 18:34:26 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-01 14:48:13 (GMT)
commit72dd6806095a8a8b8ef2a4e55e476014882a62fe (patch)
tree6df8471bd7ef4faf3084ad2563e4e51bc6e330d8
parentba74c58ca45071178b37f24f254039ea53c56cdc (diff)
downloadCMake-72dd6806095a8a8b8ef2a4e55e476014882a62fe.zip
CMake-72dd6806095a8a8b8ef2a4e55e476014882a62fe.tar.gz
CMake-72dd6806095a8a8b8ef2a4e55e476014882a62fe.tar.bz2
FindMatlab: follow CMP0074 <PackageName>_ROOT search behavior
-rw-r--r--Modules/FindMatlab.cmake17
1 files changed, 16 insertions, 1 deletions
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 1d88985..ec2c345 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -85,10 +85,18 @@ Module Input Variables
Users or projects may set the following variables to configure the module
behavior:
+:variable:`Matlab_ROOT <<PackageName>_ROOT>`
+ .. versionadded:: 3.25
+
+ Default value for :variable:`Matlab_ROOT_DIR`, the root of the Matlab
+ installation.
+
:variable:`Matlab_ROOT_DIR`
- the root of the Matlab installation.
+ The root of the Matlab installation.
+
:variable:`MATLAB_FIND_DEBUG`
outputs debug information
+
:variable:`MATLAB_ADDITIONAL_VERSIONS`
additional versions of Matlab for the automatic retrieval of the installed
versions.
@@ -1581,6 +1589,13 @@ endfunction()
# this variable will get all Matlab installations found in the current system.
set(_matlab_possible_roots)
+if(NOT DEFINED Matlab_ROOT AND DEFINED ENV{Matlab_ROOT})
+ set(Matlab_ROOT $ENV{Matlab_ROOT})
+endif()
+if(DEFINED Matlab_ROOT)
+ set(Matlab_ROOT_DIR ${Matlab_ROOT})
+endif()
+
if(Matlab_ROOT_DIR)
# if the user specifies a possible root, we keep this one