Browse Source

FindMatlab: Add MEX binary file suffix for Apple Silicon native Matlab

The Matlab MEX binary file suffix is distinct for Apple Silicon.
Michael Hirsch 3 years ago
parent
commit
f0edac914a
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Modules/FindMatlab.cmake

+ 5 - 1
Modules/FindMatlab.cmake

@@ -1741,7 +1741,11 @@ endif()
 if(APPLE)
   set(_matlab_bin_prefix "mac") # i should be for intel
   set(_matlab_bin_suffix_32bits "i")
-  set(_matlab_bin_suffix_64bits "i64")
+  if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
+    set(_matlab_bin_suffix_64bits "a64")
+  else()
+    set(_matlab_bin_suffix_64bits "i64")
+  endif()
 elseif(UNIX)
   set(_matlab_bin_prefix "gln")
   set(_matlab_bin_suffix_32bits "x86")