summaryrefslogtreecommitdiffstats
path: root/Modules/FindMatlab.cmake
diff options
context:
space:
mode:
authorJason Heeris <jason.heeris@gmail.com>2018-07-24 03:56:01 (GMT)
committerBrad King <brad.king@kitware.com>2018-08-01 13:23:46 (GMT)
commitf34f6eb3d160d500c5c5e2cba131d64c75aa046a (patch)
tree32497a607f8fe07702958bfb0b6451a1adcad39f /Modules/FindMatlab.cmake
parentf0e82ce9a2f50e7ce0b9b95dcf32e47ce9a08369 (diff)
downloadCMake-f34f6eb3d160d500c5c5e2cba131d64c75aa046a.zip
CMake-f34f6eb3d160d500c5c5e2cba131d64c75aa046a.tar.gz
CMake-f34f6eb3d160d500c5c5e2cba131d64c75aa046a.tar.bz2
FindMatlab: Add component to find MCC, the Matlab compiler
Add component `MCC_COMPILER` to request searching for the Matlab compiler. Report it in `Matlab_MCC_COMPILER` if it is found. Issue: #18183
Diffstat (limited to 'Modules/FindMatlab.cmake')
-rw-r--r--Modules/FindMatlab.cmake23
1 files changed, 22 insertions, 1 deletions
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 54e62db..5b60c6a 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -25,6 +25,7 @@
# available on the MCR version, and will yield an error if the MCR is found
# instead of the regular Matlab installation.
# * ``MEX_COMPILER`` the MEX compiler.
+# * ``MCC_COMPILER`` the MCC compiler, included with the Matlab Compiler add-on.
# * ``SIMULINK`` the Simulink environment.
#
# .. note::
@@ -110,7 +111,10 @@
# the whole set of libraries of Matlab
# ``Matlab_MEX_COMPILER``
# the mex compiler of Matlab. Currently not used.
-# Available only if the component ``MEX_COMPILER`` is asked
+# Available only if the component ``MEX_COMPILER`` is requested.
+# ``Matlab_MCC_COMPILER``
+# the mcc compiler of Matlab. Included with the Matlab Compiler add-on.
+# Available only if the component ``MCC_COMPILER`` is requested.
#
# Cached variables
# """"""""""""""""
@@ -1420,6 +1424,7 @@ if(DEFINED Matlab_ROOT_DIR_LAST_CACHED)
Matlab_INCLUDE_DIRS
Matlab_MEX_LIBRARY
Matlab_MEX_COMPILER
+ Matlab_MCC_COMPILER
Matlab_MAIN_PROGRAM
Matlab_MX_LIBRARY
Matlab_ENG_LIBRARY
@@ -1660,6 +1665,22 @@ if(_matlab_find_simulink GREATER -1)
endif()
unset(_matlab_find_simulink)
+# component MCC Compiler
+list(FIND Matlab_FIND_COMPONENTS MCC_COMPILER _matlab_find_mcc_compiler)
+if(_matlab_find_mcc_compiler GREATER -1)
+ find_program(
+ Matlab_MCC_COMPILER
+ "mcc"
+ PATHS ${Matlab_BINARIES_DIR}
+ DOC "Matlab MCC compiler"
+ NO_DEFAULT_PATH
+ )
+ if(Matlab_MCC_COMPILER)
+ set(Matlab_MCC_COMPILER_FOUND TRUE)
+ endif()
+endif()
+unset(_matlab_find_mcc_compiler)
+
unset(_matlab_lib_dir_for_search)
set(Matlab_LIBRARIES ${Matlab_MEX_LIBRARY} ${Matlab_MX_LIBRARY} ${Matlab_ENG_LIBRARY} ${Matlab_MAT_LIBRARY})