2013-10-15 19:17:36 +04:00
|
|
|
#.rst:
|
|
|
|
# FindMatlab
|
|
|
|
# ----------
|
|
|
|
#
|
|
|
|
# this module looks for Matlab
|
|
|
|
#
|
2005-12-14 21:51:08 +03:00
|
|
|
# Defines:
|
2013-10-15 19:17:36 +04:00
|
|
|
#
|
|
|
|
# ::
|
|
|
|
#
|
|
|
|
# MATLAB_INCLUDE_DIR: include path for mex.h, engine.h
|
|
|
|
# MATLAB_LIBRARIES: required libraries: libmex, etc
|
|
|
|
# MATLAB_MEX_LIBRARY: path to libmex.lib
|
|
|
|
# MATLAB_MX_LIBRARY: path to libmx.lib
|
|
|
|
# MATLAB_ENG_LIBRARY: path to libeng.lib
|
2005-09-08 18:01:46 +04:00
|
|
|
|
2009-09-28 19:45:50 +04:00
|
|
|
#=============================================================================
|
|
|
|
# Copyright 2005-2009 Kitware, Inc.
|
|
|
|
#
|
|
|
|
# Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
# see accompanying file Copyright.txt for details.
|
|
|
|
#
|
|
|
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the License for more information.
|
|
|
|
#=============================================================================
|
2010-08-07 04:48:47 +04:00
|
|
|
# (To distribute this file outside of CMake, substitute the full
|
2009-09-28 19:45:50 +04:00
|
|
|
# License text for the above reference.)
|
2005-09-08 18:01:46 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
set(MATLAB_FOUND 0)
|
|
|
|
if(WIN32)
|
|
|
|
if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6")
|
|
|
|
set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc60")
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(${CMAKE_GENERATOR} MATCHES "Visual Studio 7")
|
2005-09-08 18:01:46 +04:00
|
|
|
# Assume people are generally using 7.1,
|
|
|
|
# if using 7.0 need to link to: ../extern/lib/win32/microsoft/msvc70
|
2012-08-13 21:47:32 +04:00
|
|
|
set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/msvc71")
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(${CMAKE_GENERATOR} MATCHES "Borland")
|
2005-09-08 18:01:46 +04:00
|
|
|
# Same here, there are also: bcc50 and bcc51 directories
|
2012-08-13 21:47:32 +04:00
|
|
|
set(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/bcc54")
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(MATLAB_FIND_REQUIRED)
|
|
|
|
message(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(MATLAB_MEX_LIBRARY
|
2005-09-08 18:01:46 +04:00
|
|
|
libmex
|
|
|
|
${MATLAB_ROOT}
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(MATLAB_MX_LIBRARY
|
2005-09-08 18:01:46 +04:00
|
|
|
libmx
|
|
|
|
${MATLAB_ROOT}
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(MATLAB_ENG_LIBRARY
|
2005-09-08 18:01:46 +04:00
|
|
|
libeng
|
|
|
|
${MATLAB_ROOT}
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
find_path(MATLAB_INCLUDE_DIR
|
2005-09-08 18:01:46 +04:00
|
|
|
"mex.h"
|
|
|
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/include"
|
|
|
|
)
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
2005-09-08 18:01:46 +04:00
|
|
|
# Regular x86
|
2012-08-13 21:47:32 +04:00
|
|
|
set(MATLAB_ROOT
|
2005-09-08 18:01:46 +04:00
|
|
|
/usr/local/matlab-7sp1/bin/glnx86/
|
|
|
|
/opt/matlab-7sp1/bin/glnx86/
|
|
|
|
$ENV{HOME}/matlab-7sp1/bin/glnx86/
|
|
|
|
$ENV{HOME}/redhat-matlab/bin/glnx86/
|
|
|
|
)
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2005-09-08 18:01:46 +04:00
|
|
|
# AMD64:
|
2012-08-13 21:47:32 +04:00
|
|
|
set(MATLAB_ROOT
|
2005-09-08 18:01:46 +04:00
|
|
|
/usr/local/matlab-7sp1/bin/glnxa64/
|
|
|
|
/opt/matlab-7sp1/bin/glnxa64/
|
|
|
|
$ENV{HOME}/matlab7_64/bin/glnxa64/
|
|
|
|
$ENV{HOME}/matlab-7sp1/bin/glnxa64/
|
|
|
|
$ENV{HOME}/redhat-matlab/bin/glnxa64/
|
|
|
|
)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(MATLAB_MEX_LIBRARY
|
2005-09-08 18:01:46 +04:00
|
|
|
mex
|
|
|
|
${MATLAB_ROOT}
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(MATLAB_MX_LIBRARY
|
2005-09-08 18:01:46 +04:00
|
|
|
mx
|
|
|
|
${MATLAB_ROOT}
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
find_library(MATLAB_ENG_LIBRARY
|
2005-09-08 18:01:46 +04:00
|
|
|
eng
|
|
|
|
${MATLAB_ROOT}
|
|
|
|
)
|
2012-08-13 21:47:32 +04:00
|
|
|
find_path(MATLAB_INCLUDE_DIR
|
2005-09-08 18:01:46 +04:00
|
|
|
"mex.h"
|
|
|
|
"/usr/local/matlab-7sp1/extern/include/"
|
|
|
|
"/opt/matlab-7sp1/extern/include/"
|
|
|
|
"$ENV{HOME}/matlab-7sp1/extern/include/"
|
|
|
|
"$ENV{HOME}/redhat-matlab/extern/include/"
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2005-09-08 18:01:46 +04:00
|
|
|
|
|
|
|
# This is common to UNIX and Win32:
|
2012-08-13 21:47:32 +04:00
|
|
|
set(MATLAB_LIBRARIES
|
2005-09-08 18:01:46 +04:00
|
|
|
${MATLAB_MEX_LIBRARY}
|
|
|
|
${MATLAB_MX_LIBRARY}
|
|
|
|
${MATLAB_ENG_LIBRARY}
|
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
if(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES)
|
|
|
|
set(MATLAB_FOUND 1)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2005-09-08 18:01:46 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
mark_as_advanced(
|
2005-09-08 18:01:46 +04:00
|
|
|
MATLAB_LIBRARIES
|
|
|
|
MATLAB_MEX_LIBRARY
|
|
|
|
MATLAB_MX_LIBRARY
|
|
|
|
MATLAB_ENG_LIBRARY
|
|
|
|
MATLAB_INCLUDE_DIR
|
|
|
|
MATLAB_FOUND
|
|
|
|
MATLAB_ROOT
|
|
|
|
)
|
|
|
|
|