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 IF(MATLAB_FIND_REQUIRED)
25 MESSAGE(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}")
26 ENDIF(MATLAB_FIND_REQUIRED)
27 ENDIF(${CMAKE_GENERATOR} MATCHES "Borland")
28 ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
29 ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
30 FIND_LIBRARY(MATLAB_MEX_LIBRARY
34 FIND_LIBRARY(MATLAB_MX_LIBRARY
38 FIND_LIBRARY(MATLAB_ENG_LIBRARY
43 FIND_PATH(MATLAB_INCLUDE_DIR
45 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/include"
48 IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
51 /usr/local/matlab-7sp1/bin/glnx86/
52 /opt/matlab-7sp1/bin/glnx86/
53 $ENV{HOME}/matlab-7sp1/bin/glnx86/
54 $ENV{HOME}/redhat-matlab/bin/glnx86/
56 ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
59 /usr/local/matlab-7sp1/bin/glnxa64/
60 /opt/matlab-7sp1/bin/glnxa64/
61 $ENV{HOME}/matlab7_64/bin/glnxa64/
62 $ENV{HOME}/matlab-7sp1/bin/glnxa64/
63 $ENV{HOME}/redhat-matlab/bin/glnxa64/
65 ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4)
66 FIND_LIBRARY(MATLAB_MEX_LIBRARY
70 FIND_LIBRARY(MATLAB_MX_LIBRARY
74 FIND_LIBRARY(MATLAB_ENG_LIBRARY
78 FIND_PATH(MATLAB_INCLUDE_DIR
80 "/usr/local/matlab-7sp1/extern/include/"
81 "/opt/matlab-7sp1/extern/include/"
82 "$ENV{HOME}/matlab-7sp1/extern/include/"
83 "$ENV{HOME}/redhat-matlab/extern/include/"
88 # This is common to UNIX and Win32:
95 IF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
97 ENDIF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)