diff options
author | Raffi Enficiaud <raffi.enficiaud@mines-paris.org> | 2019-07-14 23:52:02 (GMT) |
---|---|---|
committer | Raffi Enficiaud <raffi.enficiaud@mines-paris.org> | 2019-07-14 23:52:02 (GMT) |
commit | 9e6206c59bc00be53351cd87ad569896686aeb89 (patch) | |
tree | e4dc3f4e6fa4d27755266213d0930d65ff35912d /Modules | |
parent | a9b36ea69f36cbfe198bcd5d34a19955651dfa5a (diff) | |
download | CMake-9e6206c59bc00be53351cd87ad569896686aeb89.zip CMake-9e6206c59bc00be53351cd87ad569896686aeb89.tar.gz CMake-9e6206c59bc00be53351cd87ad569896686aeb89.tar.bz2 |
FindMatlab: fixing extension bat file invocation error
If the environment variable MATLAB_ARCH is set prior to the call, the
called scripts do not return an error message.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindMatlab.cmake | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index 26b9419..4325623 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -609,14 +609,23 @@ function(matlab_get_mex_suffix matlab_root mex_suffix) set(devnull INPUT_FILE NUL) endif() + if(WIN32) + # this environment variable is used to determine the arch on Windows + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(ENV{MATLAB_ARCH} "win64") + else() + set(ENV{MATLAB_ARCH} "win32") + endif() + endif() + # this is the preferred way. If this does not work properly (eg. MCR on Windows), then we use our own knowledge execute_process( COMMAND ${Matlab_MEXEXTENSIONS_PROG} OUTPUT_VARIABLE _matlab_mex_extension - #RESULT_VARIABLE _matlab_mex_extension_call ERROR_VARIABLE _matlab_mex_extension_error OUTPUT_STRIP_TRAILING_WHITESPACE ${devnull}) + unset(ENV{MATLAB_ARCH}) if(_matlab_mex_extension_error) if(WIN32) @@ -631,7 +640,7 @@ function(matlab_get_mex_suffix matlab_root mex_suffix) string(STRIP "${_matlab_mex_extension}" _matlab_mex_extension) if(MATLAB_FIND_DEBUG) - message(STATUS "[MATLAB] '${Matlab_MEXEXTENSIONS_PROG}' : returned '${_matlab_mex_extension_call}', determined extension '${_matlab_mex_extension}' and error string is '${_matlab_mex_extension_error}'") + message(STATUS "[MATLAB] '${Matlab_MEXEXTENSIONS_PROG}' : determined extension '${_matlab_mex_extension}' and error string is '${_matlab_mex_extension_error}'") endif() unset(Matlab_MEXEXTENSIONS_PROG CACHE) |