From 73621c564df5e17694614a29b19876219878e2a5 Mon Sep 17 00:00:00 2001 From: Sarah Gilmore Date: Wed, 22 Nov 2023 14:58:34 -0500 Subject: [PATCH] Check if the matlab release derived from Matlab_ROOT_DIR and Matlab_ADDITIONAL_VERSIONS match --- matlab/tools/cmake/BuildMatlabArrowInterface.cmake | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/matlab/tools/cmake/BuildMatlabArrowInterface.cmake b/matlab/tools/cmake/BuildMatlabArrowInterface.cmake index ddf41a173665e..98dab2d7a7394 100644 --- a/matlab/tools/cmake/BuildMatlabArrowInterface.cmake +++ b/matlab/tools/cmake/BuildMatlabArrowInterface.cmake @@ -48,11 +48,12 @@ function(set_matlab_variables) message(STATUS "matlab_release_name = ${matlab_release_name}") string(SUBSTRING ${MATLAB_ADDITIONAL_VERSIONS} 0 ${matlab_additional_versions_length} matlab_release_version) message(STATUS "matlab_release_version = ${matlab_release_version}") + get_filename_component(matlab_root_dir_release ${Matlab_ROOT_DIR} NAME) + message(STATUS "matlab_root_dir_release = ${matlab_root_dir_release}") - if (${Matlab_ROOT_DIR} MATCHES "(\\${matlab_release_name}|/${matlab_release_name})$") - message(STATUS "matches!!!") - else() - message(STATUS "does NOT match") + if (NOT ${matlab_root_dir_release} STREQUAL ${matlab_release_name}) + message(STATUS "Does not match!!!") + message(FATAL_ERROR "Unknown MATLAB Release"); endif() endfunction()