diff options
author | scivision <scivision@users.noreply.github.com> | 2024-01-16 04:36:13 (GMT) |
---|---|---|
committer | scivision <scivision@users.noreply.github.com> | 2024-01-17 03:34:01 (GMT) |
commit | 9e97893147e7233381b545fe20aa192ba2b7dd6b (patch) | |
tree | 24a494b35cd894d154f0e5c1730177f0ad5a2aba /Modules | |
parent | 7010eb5feaf94470abeb058a77b0af80d043f157 (diff) | |
download | CMake-9e97893147e7233381b545fe20aa192ba2b7dd6b.zip CMake-9e97893147e7233381b545fe20aa192ba2b7dd6b.tar.gz CMake-9e97893147e7233381b545fe20aa192ba2b7dd6b.tar.bz2 |
FindMatlab: set MATLAB_ARCH per process call
this is just a best practice refactor.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindMatlab.cmake | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake index c5379d5..f14fa7e 100644 --- a/Modules/FindMatlab.cmake +++ b/Modules/FindMatlab.cmake @@ -660,23 +660,23 @@ function(matlab_get_mex_suffix matlab_root mex_suffix) set(devnull INPUT_FILE NUL) endif() + set(_arch) 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") + set(_arch "MATLAB_ARCH=win64") else() - set(ENV{MATLAB_ARCH} "win32") + set(_arch "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} + COMMAND ${CMAKE_COMMAND} -E env ${_arch} ${Matlab_MEXEXTENSIONS_PROG} OUTPUT_VARIABLE _matlab_mex_extension ERROR_VARIABLE _matlab_mex_extension_error OUTPUT_STRIP_TRAILING_WHITESPACE ${devnull}) - unset(ENV{MATLAB_ARCH}) if(_matlab_mex_extension_error) if(WIN32) |