1 # - this module looks for Matlab
3 # MATLAB_INCLUDE_DIR: include path for mex.h, engine.h
4 # MATLAB_LIBRARIES: required libraries: libmex, etc
5 # MATLAB_MEX_LIBRARY: path to libmex.lib
6 # MATLAB_MX_LIBRARY: path to libmx.lib
7 # MATLAB_ENG_LIBRARY: path to libeng.lib
12 IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
13 SET(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc60")
14 ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
15 IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
16 # Assume people are generally using 7.1,
17 # if using 7.0 need to link to: ../extern/lib/win32/microsoft/msvc70
18 SET(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc71")
19 ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
20 IF(${CMAKE_GENERATOR} MATCHES "Borland")
21 # Same here, there are also: bcc50 and bcc51 directories
22 SET(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/bcc54")
23 ELSE(${CMAKE_GENERATOR} MATCHES "Borland")
24 MESSAGE(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}")
25 ENDIF(${CMAKE_GENERATOR} MATCHES "Borland")
26 ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
27 ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
28 FIND_LIBRARY(MATLAB_MEX_LIBRARY
32 FIND_LIBRARY(MATLAB_MX_LIBRARY
36 FIND_LIBRARY(MATLAB_ENG_LIBRARY
41 FIND_PATH(MATLAB_INCLUDE_DIR
43 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/include"
46 IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
49 /usr/local/matlab-7sp1/bin/glnx86/
50 /opt/matlab-7sp1/bin/glnx86/
51 $ENV{HOME}/matlab-7sp1/bin/glnx86/
52 $ENV{HOME}/redhat-matlab/bin/glnx86/
54 ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
57 /usr/local/matlab-7sp1/bin/glnxa64/
58 /opt/matlab-7sp1/bin/glnxa64/
59 $ENV{HOME}/matlab7_64/bin/glnxa64/
60 $ENV{HOME}/matlab-7sp1/bin/glnxa64/
61 $ENV{HOME}/redhat-matlab/bin/glnxa64/
63 ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4)
64 FIND_LIBRARY(MATLAB_MEX_LIBRARY
68 FIND_LIBRARY(MATLAB_MX_LIBRARY
72 FIND_LIBRARY(MATLAB_ENG_LIBRARY
76 FIND_PATH(MATLAB_INCLUDE_DIR
78 "/usr/local/matlab-7sp1/extern/include/"
79 "/opt/matlab-7sp1/extern/include/"
80 "$ENV{HOME}/matlab-7sp1/extern/include/"
81 "$ENV{HOME}/redhat-matlab/extern/include/"
86 # This is common to UNIX and Win32:
93 IF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
95 ENDIF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)