Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
ac748747
Commit
ac748747
authored
Mar 12, 2013
by
Hilton Bristow
Committed by
hbristow
Jun 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FindMatlab.cmake in cmake find_package format
parent
de93408d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
CMakeLists.txt
CMakeLists.txt
+3
-2
FindMatlab.cmake
cmake/Modules/FindMatlab.cmake
+14
-9
No files found.
CMakeLists.txt
View file @
ac748747
...
...
@@ -59,7 +59,7 @@ if(DEFINED CMAKE_BUILD_TYPE AND CMAKE_VERSION VERSION_GREATER "2.8")
endif
()
project
(
OpenCV CXX C
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
${
CMAKE_SOURCE_DIR
}
/cmake/Modules
)
include
(
cmake/OpenCVUtils.cmake
)
# ----------------------------------------------------------------------------
...
...
@@ -422,7 +422,8 @@ if(WITH_OPENCL)
endif
()
# --- Matlab/Octave ---
include
(
cmake/OpenCVFindMatlab.cmake
)
find_package
(
matlab
)
#include(cmake/OpenCVFindMatlab.cmake)
# ----------------------------------------------------------------------------
# Solution folders:
...
...
cmake/
OpenCV
FindMatlab.cmake
→
cmake/
Modules/
FindMatlab.cmake
View file @
ac748747
...
...
@@ -7,8 +7,8 @@
# MATLAB_FOUND: true/false
# MATLAB_ROOT_DIR: Root of Matlab installation
# MATLAB_MEX_SCRIPT The mex script used to compile mex files
# MATLAB_INCLUDE_DIR
S
Path to "mex.h"
# MATLAB_LIBRARY_DIR
S
Path to mex and matrix libraries
# MATLAB_INCLUDE_DIR
Path to "mex.h"
# MATLAB_LIBRARY_DIR
Path to mex and matrix libraries
# MATLAB_LIBS The Matlab libs, usually mx, mex, mat
# MATLAB_MEXEXT The mex library extension. It will be one of:
# mexwin32, mexwin64, mexglx, mexa64, mexmac,
...
...
@@ -76,6 +76,10 @@ MACRO(locate_matlab_root)
endforeach
()
endif
()
# unset local variables
unset
(
REG_ROOTS_
)
unset
(
REG_ROOT_
)
unset
(
VERSIONS_
)
unset
(
VERSION_
)
unset
(
SEARCH_DIRS_
)
unset
(
DIR_
)
endMACRO
()
...
...
@@ -99,16 +103,16 @@ MACRO(locate_matlab_components MATLAB_ROOT_DIR)
string
(
REPLACE
"mex"
""
MATLAB_ARCH
${
MATLAB_MEXEXT
}
)
# get the path to the libraries
set
(
MATLAB_LIBRARY_DIR
S
${
MATLAB_ROOT_DIR
}
/bin/
${
MATLAB_ARCH
}
)
set
(
MATLAB_LIBRARY_DIR
${
MATLAB_ROOT_DIR
}
/bin/
${
MATLAB_ARCH
}
)
# get the libraries
find_library
(
MATLAB_LIB_MX mx PATHS
${
MATLAB_LIBRARY_DIR
S
}
NO_DEFAULT_PATH
)
find_library
(
MATLAB_LIB_MEX mex PATHS
${
MATLAB_LIBRARY_DIR
S
}
NO_DEFAULT_PATH
)
find_library
(
MATLAB_LIB_MAT mat PATHS
${
MATLAB_LIBRARY_DIR
S
}
NO_DEFAULT_PATH
)
find_library
(
MATLAB_LIB_MX mx PATHS
${
MATLAB_LIBRARY_DIR
}
NO_DEFAULT_PATH
)
find_library
(
MATLAB_LIB_MEX mex PATHS
${
MATLAB_LIBRARY_DIR
}
NO_DEFAULT_PATH
)
find_library
(
MATLAB_LIB_MAT mat PATHS
${
MATLAB_LIBRARY_DIR
}
NO_DEFAULT_PATH
)
set
(
MATLAB_LIBS
${
MATLAB_LIB_MX
}
${
MATLAB_LIB_MEX
}
${
MATLAB_LIB_MAT
}
)
# get the include path
find_path
(
MATLAB_INCLUDE_DIR
S
mex.h
${
MATLAB_ROOT_DIR
}
/extern/include
)
find_path
(
MATLAB_INCLUDE_DIR mex.h
${
MATLAB_ROOT_DIR
}
/extern/include
)
# get the mex shell script
find_file
(
MATLAB_MEX_SCRIPT NAMES mex mex.bat PATHS
${
MATLAB_ROOT_DIR
}
/bin NO_DEFAULT_PATH
)
...
...
@@ -133,8 +137,9 @@ if (NOT MATLAB_FOUND)
if
(
MATLAB_ROOT_DIR
)
locate_matlab_components
(
${
MATLAB_ROOT_DIR
}
)
endif
()
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
Matlab DEFAULT_MSG MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIRS
MATLAB_LIBS MATLAB_LIBRARY_DIRS MATLAB_MEXEXT MATLAB_ARCH
)
find_package_handle_standard_args
(
Matlab DEFAULT_MSG MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIR
MATLAB_ROOT_DIR MATLAB_LIBS MATLAB_LIBRARY_DIR
MATLAB_MEXEXT MATLAB_ARCH
)
# if Matlab was not found, unset the local variables
if
(
NOT MATLAB_FOUND
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment