summaryrefslogtreecommitdiff
path: root/Modules/FindMatlab.cmake
diff options
context:
space:
mode:
authorAlexey Kreschuk <akrsch@gmail.com>2020-07-08 08:46:35 -0400
committerBrad King <brad.king@kitware.com>2020-07-08 08:56:10 -0400
commita3c389cb17b69c041650e7abc434619809f28e09 (patch)
tree057152da0e3671ace1367e325746931197d10ece /Modules/FindMatlab.cmake
parent89845851a74d3dd47275803848593c2cd27e9325 (diff)
downloadcmake-a3c389cb17b69c041650e7abc434619809f28e09.tar.gz
FindMatlab: set MATLAB_DEFAULT_RELEASE for unknown version
An "unknown" version does not always mean an old version. Setting this macro by mistake does not result in a compilation error, but not setting it does. I had this error when compiling from a user that does not have a matlab license.
Diffstat (limited to 'Modules/FindMatlab.cmake')
-rw-r--r--Modules/FindMatlab.cmake5
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index e42c20654d..05ec3ae5df 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -992,7 +992,10 @@ function(matlab_add_mex)
endif()
endif()
- if(NOT Matlab_VERSION_STRING VERSION_LESS "9.4") # For 9.4 (R2018a) and newer, add API macro
+ # For 9.4 (R2018a) and newer, add API macro.
+ # Add it for unknown versions too, just in case.
+ if(NOT Matlab_VERSION_STRING VERSION_LESS "9.4"
+ OR Matlab_VERSION_STRING STREQUAL "unknown")
if(${${prefix}_R2018a})
set(MEX_API_MACRO "MATLAB_DEFAULT_RELEASE=R2018a")
else()