Skip to content

Commit 087a100

Browse files
authored
Merge pull request #3313 from Qubiz:Qubiz-find-hdr-parser-path-using-OpenCV_SOURCE_DIR
matlab: Use OpenCV_SOURCE_DIR instead of CMAKE_SOURCE_DIR to find the modules root * Set HDR_PARSER_PATH using OpenCV_SOURCE_DIR var This sets the `HDR_PARSER_PATH` variable using `OpenCV_SOURCE_DIR` instead of using `CMAKE_SOURCE_DIR`. This allows for more flexibility in how the user's project can be structured. * Find OpenCV module root using OpenCV_SOURCE_DIR
1 parent d85887c commit 087a100

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/matlab/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ execute_process(COMMAND git log -1 --pretty=%H OUTPUT_VARIABLE GIT_COMMIT ERROR_
120120
string(REGEX REPLACE "(\r?\n)+$" "" GIT_COMMIT "${GIT_COMMIT}")
121121

122122
# set the path to the C++ header and doc parser, and template engine
123-
set(HDR_PARSER_PATH ${CMAKE_SOURCE_DIR}/modules/python/src2)
123+
set(HDR_PARSER_PATH ${OpenCV_SOURCE_DIR}/modules/python/src2)
124124

125125
# set mex compiler options
126126
prepend("-I" MEX_INCLUDE_DIRS ${CMAKE_BINARY_DIR})
@@ -234,7 +234,7 @@ add_custom_command(
234234
COMMAND ${PYTHON_DEFAULT_EXECUTABLE}
235235
${CMAKE_CURRENT_SOURCE_DIR}/generator/gen_matlab.py
236236
--hdrparser ${HDR_PARSER_PATH}
237-
--moduleroot ${CMAKE_SOURCE_DIR}/modules ${OPENCV_EXTRA_MODULES_PATH}
237+
--moduleroot ${OpenCV_SOURCE_DIR}/modules ${OPENCV_EXTRA_MODULES_PATH}
238238
--modules ${opencv_modules}
239239
--extra ${opencv_extra_hdrs}
240240
--outdir ${CMAKE_CURRENT_BINARY_DIR}

0 commit comments

Comments
 (0)