33# See the FindMathematica manual for usage hints.
44#
55#=============================================================================
6- # Copyright 2010-2020 Sascha Kratky
6+ # Copyright 2010-2021 Sascha Kratky
77#
88# Permission is hereby granted, free of charge, to any person)
99# obtaining a copy of this software and associated documentation)
@@ -34,7 +34,7 @@ cmake_minimum_required(VERSION 2.8.12)
3434cmake_policy (POP)
3535
3636set (Mathematica_CMAKE_MODULE_DIR "${CMAKE_CURRENT_LIST_DIR} " )
37- set (Mathematica_CMAKE_MODULE_VERSION "3.4 .0" )
37+ set (Mathematica_CMAKE_MODULE_VERSION "3.5 .0" )
3838
3939# activate select policies
4040if (POLICY CMP0025)
@@ -245,7 +245,7 @@ macro (_get_program_names _outProgramNames)
245245 set (_MathematicaApps "Mathematica" "Wolfram Desktop" "Wolfram Engine" "gridMathematica Server" )
246246 # Mathematica product versions in order of preference
247247 set (_MathematicaVersions
248- "12.2" "12.1" "12.0"
248+ "12.3" "12. 2" "12.1" "12.0"
249249 "11.3" "11.2" "11.1" "11.0"
250250 "10.4" "10.3" "10.2" "10.1" "10.0"
251251 "9.0" "8.0" "7.0" "6.0" "5.2" )
@@ -500,6 +500,8 @@ macro (_systemNameToSystemID _systemName _systemProcessor _outSystemIDs)
500500 set (${_outSystemIDs} "MacOSX-x86" )
501501 elseif ("${_systemProcessor} " STREQUAL "x86_64" )
502502 set (${_outSystemIDs} "MacOSX-x86-64" )
503+ elseif ("${_systemProcessor} " STREQUAL "arm64" )
504+ set (${_outSystemIDs} "MacOSX-ARM64" )
503505 elseif ("${_systemProcessor} " MATCHES "ppc64|powerpc64" )
504506 set (${_outSystemIDs} "Darwin-PowerPC64" )
505507 elseif ("${_systemProcessor} " MATCHES "ppc|powerpc" )
@@ -648,7 +650,12 @@ macro (_get_host_system_IDs _outSystemIDs)
648650endmacro ()
649651
650652macro (_get_supported_systemIDs _version _outSystemIDs)
651- if (NOT "${_version} " VERSION_LESS "12.1" )
653+ if (NOT "${_version} " VERSION_LESS "12.3" )
654+ set (${_outSystemIDs}
655+ "Windows-x86-64"
656+ "Linux-x86-64" "Linux-ARM"
657+ "MacOSX-x86-64" "MacOSX-ARM64" )
658+ elseif (NOT "${_version} " VERSION_LESS "12.1" )
652659 set (${_outSystemIDs}
653660 "Windows-x86-64"
654661 "Linux-x86-64" "Linux-ARM"
@@ -741,6 +748,19 @@ macro (_get_compatible_system_IDs _systemID _outSystemIDs)
741748 else ()
742749 list (APPEND ${_outSystemIDs} "MacOSX-x86-64" "MacOSX-x86" )
743750 endif ()
751+ elseif ("${_systemID} " MATCHES "MacOSX-ARM64" )
752+ if (Mathematica_VERSION)
753+ # Mathematica 12.3 added support for MacOSX-ARM64
754+ if (NOT "${Mathematica_VERSION} " VERSION_LESS "12.3" )
755+ list (APPEND ${_outSystemIDs} "MacOSX-ARM64" )
756+ endif ()
757+ # Mathematica 6 added support for MacOSX-x86-64
758+ if (NOT "${Mathematica_VERSION} " VERSION_LESS "6.0" )
759+ list (APPEND ${_outSystemIDs} "MacOSX-x86-64" )
760+ endif ()
761+ else ()
762+ list (APPEND ${_outSystemIDs} "MacOSX-ARM64" "MacOSX-x86-64" )
763+ endif ()
744764 elseif ("${_systemID} " STREQUAL "Darwin-PowerPC64" )
745765 if (Mathematica_VERSION)
746766 if (NOT "${Mathematica_VERSION} " VERSION_LESS "5.2" AND
@@ -801,7 +821,7 @@ macro(_get_developer_kit_system_IDs _outSystemIDs)
801821 set (${_outSystemIDs} "" )
802822 else ()
803823 # Mathematica versions after 9 have a system ID subdirectory
804- set (${_outSystemIDs} "MacOSX-x86-64" )
824+ set (${_outSystemIDs} "MacOSX-x86-64" "MacOSX-ARM64" )
805825 endif ()
806826 else ()
807827 _get_system_IDs(${_outSystemIDs} )
@@ -819,8 +839,8 @@ macro(_get_host_developer_kit_system_IDs _outSystemIDs)
819839 if ("${Mathematica_VERSION} " VERSION_LESS "9.0" )
820840 set (${_outSystemIDs} "" )
821841 else ()
822- # The MacOSX-x86-64 DeveloperKit is a universal binary with architectures i386 and x86_64
823- set (${_outSystemIDs} "MacOSX-x86-64" )
842+ # Mathematica versions after 9 have a system ID subdirectory
843+ set (${_outSystemIDs} "MacOSX-x86-64" "MacOSX-ARM64" )
824844 endif ()
825845 else ()
826846 _get_host_system_IDs(${_outSystemIDs} )
@@ -3019,6 +3039,8 @@ macro (_add_launch_prefix _cmdVar _systemIDVar)
30193039 list (APPEND ${_cmdVar} "/usr/bin/arch" "-i386" )
30203040 elseif ("${${_systemIDVar} }" STREQUAL "MacOSX-x86-64" )
30213041 list (APPEND ${_cmdVar} "/usr/bin/arch" "-x86_64" )
3042+ elseif ("${${_systemIDVar} }" STREQUAL "MacOSX-ARM64" )
3043+ list (APPEND ${_cmdVar} "/usr/bin/arch" "-arm64" )
30223044 elseif ("${${_systemIDVar} }" MATCHES "Darwin|MacOSX" )
30233045 list (APPEND ${_cmdVar} "/usr/bin/arch" "-ppc" )
30243046 elseif ("${${_systemIDVar} }" STREQUAL "Darwin-PowerPC64" )
0 commit comments