From ed8adeb3c67cfc8b72e935bb3dae00f2f9772547 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Mon, 15 Oct 2012 23:48:34 +0000 Subject: [PATCH] Actually issue errors when mex is not found. --- CMake/FindMatlabMex.cmake | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/CMake/FindMatlabMex.cmake b/CMake/FindMatlabMex.cmake index 15335d5b06..24770d3117 100644 --- a/CMake/FindMatlabMex.cmake +++ b/CMake/FindMatlabMex.cmake @@ -2,9 +2,9 @@ # The following variables are defined when the script completes: # MATLAB_MEX: location of mex compiler # MATLAB_ROOT: root of MATLAB installation -# MATLAB_MEX_FOUND: 0 if not found, 1 if found +# MATLABMEX_FOUND: 0 if not found, 1 if found -SET(MATLAB_MEX_FOUND 0) +SET(MATLABMEX_FOUND 0) IF(WIN32) # This is untested but taken from the older FindMatlab.cmake script as well as @@ -92,16 +92,17 @@ ELSE(WIN32) ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ENDIF(WIN32) -IF(MATLAB_MEX) - SET(MATLAB_MEX_FOUND 1) -ENDIF(MATLAB_MEX) +IF(NOT "${MATLAB_MEX}" AND "${MatlabMex_FIND_REQUIRED}") + MESSAGE(FATAL_ERROR "Could not find MATLAB mex compiler; try specifying MATLAB_ROOT.") +ELSE(NOT "${MATLAB_MEX}" AND "${MatlabMex_FIND_REQUIRED}") + MESSAGE(STATUS "Found MATLAB mex compiler: ${MATLAB_MEX}") + MESSAGE(STATUS "MATLAB root: ${MATLAB_ROOT}") +ENDIF(NOT "${MATLAB_MEX}" AND "${MatlabMex_FIND_REQUIRED}") -MESSAGE(STATUS "Found MATLAB mex compiler: ${MATLAB_MEX}") -MESSAGE(STATUS "MATLAB root: ${MATLAB_ROOT}") MARK_AS_ADVANCED( MATLAB_MEX - MATLAB_MEX_FOUND + MATLABMEX_FOUND MATLAB_ROOT )