Improved finding Matlab on Windows machines. Needs testing on computers that have multiple version installed

This commit is contained in:
hbristow
2013-07-31 11:24:28 +10:00
parent 627b9df85f
commit 58ca8ed97f
3 changed files with 44 additions and 47 deletions

View File

@@ -99,7 +99,6 @@ if (NOT MEX_WORKS)
# attempt to generate a gateway for a function
message(STATUS "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.py ${HDR_PARSER_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/test/test_generator.hpp ${CMAKE_BINARY_DIR}/junk

View File

@@ -9,8 +9,13 @@ class MatlabWrapperGenerator(object):
ns = {}
for file in input_files:
# get the file name
name = re.findall('include/opencv2/([^./]+)', file)[0]
#name = os.path.splitext(os.path.basename(file))[0]
# TODO: Is there a cleaner way to do this?
try:
name = re.findall('include/opencv2/([^./]+)', file)[0]
except:
name = os.path.splitext(os.path.basename(file))[0]
# add the file to the namespace
try:
ns[name] = ns[name] + parser.parse(file)
except KeyError: