From f34f6eb3d160d500c5c5e2cba131d64c75aa046a Mon Sep 17 00:00:00 2001 From: Jason Heeris Date: Tue, 24 Jul 2018 13:56:01 +1000 Subject: 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 --- Help/release/dev/FindMatlab-mcc.rst | 5 +++++ Modules/FindMatlab.cmake | 23 ++++++++++++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 Help/release/dev/FindMatlab-mcc.rst diff --git a/Help/release/dev/FindMatlab-mcc.rst b/Help/release/dev/FindMatlab-mcc.rst new file mode 100644 index 0000000..71387f3 --- /dev/null +++ b/Help/release/dev/FindMatlab-mcc.rst @@ -0,0 +1,5 @@ +FindMatlab-mcc +-------------- + +* The :module:`FindMatlab` module gained a new ``MCC_COMPILER`` + component to request finding the Matlab Compiler add-on. 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}) -- cgit v0.12