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
24d5adfd
Commit
24d5adfd
authored
Jun 23, 2013
by
hbristow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added commenting to modules/matlab/CMakeLists.txt
parent
755ce9d6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
13 deletions
+35
-13
CMakeLists.txt
modules/matlab/CMakeLists.txt
+35
-13
No files found.
modules/matlab/CMakeLists.txt
View file @
24d5adfd
...
...
@@ -77,52 +77,68 @@ foreach(module ${OPENCV_MATLAB_MODULES})
endif
()
endforeach
()
# attempt to generate a gateway for a function
message
(
"-- Trying to generate Matlab code"
)
execute_process
(
# Configure checks
# Check to see whether the generator and the mex compiler are working.
# The checks currently test:
# - whether the python generator can be found
# - whether the python generator correctly outputs a file for a definition
# - whether the mex compiler can find the required headers
# - whether the mex compiler can compile a trivial definition
if
(
NOT MEX_WORKS
)
# attempt to generate a gateway for a function
message
(
"-- Trying to generate Matlab code"
)
execute_process
(
COMMAND
${
CMAKE_COMMAND
}
-E touch
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/trigger.cpp
COMMAND
${
PYTHON_EXECUTABLE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/generator/gen_matlab_caller.py
${
HDR_PARSER_PATH
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/test_generator.hpp
${
CMAKE_BINARY_DIR
}
/junk
ERROR_VARIABLE GEN_ERROR
OUTPUT_QUIET
)
)
if
(
GEN_ERROR
)
if
(
GEN_ERROR
)
message
(
${
GEN_ERROR
}
)
message
(
"-- Error generating Matlab code. Disabling Matlab bindings..."
)
return
()
else
()
else
()
message
(
"-- Trying to generate Matlab code - OK"
)
endif
()
endif
()
# attempt to compile a gateway using mex
message
(
"-- Trying to compile mex file"
)
execute_process
(
# attempt to compile a gateway using mex
message
(
"-- Trying to compile mex file"
)
execute_process
(
COMMAND
${
MATLAB_MEX_SCRIPT
}
${
MEX_OPTS
}
${
MEX_INCLUDE_DIRS
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/test_compiler.cpp
WORKING_DIRECTORY
${
CMAKE_BINARY_DIR
}
/junk
ERROR_VARIABLE MEX_ERROR
OUTPUT_QUIET
)
)
if
(
MEX_ERROR
)
if
(
MEX_ERROR
)
message
(
${
MEX_ERROR
}
)
message
(
"-- Error compiling mex file. Disabling Matlab bindings..."
)
return
()
else
()
else
()
message
(
"-- Trying to compile mex file - OK"
)
endif
()
endif
()
# if we make it here, mex works!
set_property
(
GLOBAL PROPERTY MEX_WORKS TRUE
)
set
(
MEX_WORKS True CACHE BOOL ADVANCED
)
# ----------------------------------------------------------------------------
# Build time components
# ----------------------------------------------------------------------------
# proxies
# these proxies are used to trigger the add_custom_commands
# (which do the real work) only when they're outdated
set
(
GENERATE_PROXY
${
CMAKE_CURRENT_BINARY_DIR
}
/generate.proxy
)
set
(
COMPILE_PROXY
${
CMAKE_CURRENT_BINARY_DIR
}
/compile.proxy
)
# generate
# call the python executable to generate the Matlab gateways
add_custom_command
(
OUTPUT
${
GENERATE_PROXY
}
COMMAND
${
PYTHON_EXECUTABLE
}
...
...
@@ -132,6 +148,10 @@ add_custom_command(
COMMENT
"Generating matlab source files"
)
# compile
# call the mex compiler to compile the gateways
# because we don't know the source files at configure-time, this
# has to be executed in a separate script in cmake's script processing mode
add_custom_command
(
OUTPUT
${
COMPILE_PROXY
}
COMMAND
${
CMAKE_COMMAND
}
-DMATLAB_MEX_SCRIPT=
${
MATLAB_MEX_SCRIPT
}
...
...
@@ -144,6 +164,8 @@ add_custom_command(
COMMENT
"Compiling Matlab source files. This could take a while..."
)
# targets
# opencv_matlab_sources --> opencv_matlab_compile
add_custom_target
(
${
the_module
}
_sources ALL DEPENDS
${
GENERATE_PROXY
}
)
add_custom_target
(
${
the_module
}
ALL DEPENDS
${
COMPILE_PROXY
}
)
add_dependencies
(
${
the_module
}
${
the_module
}
_sources
)
...
...
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