Skip to content

Commit 4db6b7b

Browse files
committed
Wolfram App 14.1 and 14.2 compatibility
1 parent 4fdd294 commit 4db6b7b

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

CMake/Mathematica/FindMathematica.cmake

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ endmacro()
136136
# internal macro to to compute front end paths (relative to installation directory)
137137
macro (_get_host_frontend_names _outFrontEndNames)
138138
if (CMAKE_HOST_WIN32 OR CYGWIN)
139-
set (${_outFrontEndNames} "Mathematica.exe")
139+
set (${_outFrontEndNames} "WolframNB.exe" "Mathematica.exe")
140140
elseif (CMAKE_HOST_APPLE)
141-
set (${_outFrontEndNames} "Contents/MacOS/Mathematica")
141+
set (${_outFrontEndNames} "Contents/MacOS/WolframNB" "Contents/MacOS/Mathematica")
142142
elseif (CMAKE_HOST_UNIX)
143-
set (${_outFrontEndNames}
143+
set (${_outFrontEndNames} "Executables/wolframnb" "Executables/WolframNB"
144144
"Executables/mathematica" "Executables/Mathematica")
145145
endif()
146146
endmacro()
@@ -172,12 +172,12 @@ macro (_get_program_names _outProgramNames)
172172
set (${_outProgramNames} "")
173173
# Mathematica products in order of preference
174174
set (_MathematicaApps
175-
"Mathematica" "mathematica"
175+
"Wolfram" "Mathematica" "mathematica"
176176
"Wolfram Desktop" "Wolfram Engine"
177177
"gridMathematica Server")
178178
# Mathematica product versions in order of preference
179179
set (_MathematicaVersions
180-
"14.0"
180+
"14.2" "14.1" "14.0"
181181
"13.3" "13.2" "13.1" "13.0"
182182
"12.3" "12.2" "12.1" "12.0"
183183
"11.3" "11.2" "11.1" "11.0"
@@ -207,7 +207,7 @@ endmacro()
207207
# internal function to get Mathematica Windows installation directory for a registry entry
208208
function (_add_registry_search_path _registryKey _outSearchPaths)
209209
set (_ProductNamePatterns
210-
"Wolfram Mathematica [0-9.]+" "Wolfram Desktop [0-9.]+"
210+
"Wolfram Mathematica [0-9.]+" "Wolfram [0-9.]+" "Wolfram Desktop [0-9.]+"
211211
"Wolfram Engine [0-9.]+" "Wolfram Finance Platform")
212212
get_filename_component (
213213
_productName "[${_registryKey};ProductName]" NAME)
@@ -1230,11 +1230,13 @@ macro (_setup_mathematica_base_directory)
12301230
endif()
12311231
else ()
12321232
# guess Mathematica_BASE_DIR from environment
1233-
# environment variable MATHEMATICA_BASE may override default
1233+
# environment variable MATHEMATICA_BASE (or WOLFRAM_BASE) may override default
12341234
# $BaseDirectory, see
12351235
# https://reference.wolfram.com/language/tutorial/ConfigurationFiles.html
12361236
if (DEFINED ENV{MATHEMATICA_BASE})
12371237
set (Mathematica_BASE_DIR "$ENV{MATHEMATICA_BASE}")
1238+
elseif (DEFINED ENV{WOLFRAM_BASE})
1239+
set (Mathematica_BASE_DIR "$ENV{WOLFRAM_BASE}")
12381240
elseif (CMAKE_HOST_WIN32 OR CYGWIN)
12391241
if (DEFINED $ENV{PROGRAMDATA})
12401242
set (Mathematica_BASE_DIR "$ENV{PROGRAMDATA}\\Mathematica")
@@ -1282,11 +1284,13 @@ macro (_setup_mathematica_userbase_directory)
12821284
endif()
12831285
else ()
12841286
# guess Mathematica_USERBASE_DIR from environment
1285-
# environment variable MATHEMATICA_USERBASE may override default
1287+
# environment variable MATHEMATICA_USERBASE (or WOLFRAM_USERBASE) may override default
12861288
# $UserBaseDirectory, see
12871289
# https://reference.wolfram.com/language/tutorial/ConfigurationFiles.html
12881290
if (DEFINED ENV{MATHEMATICA_USERBASE})
12891291
set (Mathematica_USERBASE_DIR "$ENV{MATHEMATICA_USERBASE}")
1292+
elseif (DEFINED ENV{WOLFRAM_USERBASE})
1293+
set (Mathematica_USERBASE_DIR "$ENV{WOLFRAM_USERBASE}")
12901294
elseif (CMAKE_HOST_WIN32 OR CYGWIN)
12911295
if (DEFINED ENV{APPDATA})
12921296
set (Mathematica_USERBASE_DIR "$ENV{APPDATA}\\Mathematica")

0 commit comments

Comments
 (0)