Skip to content

Commit

Permalink
Merge pull request #3313 from Qubiz:Qubiz-find-hdr-parser-path-using-…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Qubiz authored Aug 26, 2022
1 parent d85887c commit 087a100
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/matlab/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ execute_process(COMMAND git log -1 --pretty=%H OUTPUT_VARIABLE GIT_COMMIT ERROR_
string(REGEX REPLACE "(\r?\n)+$" "" GIT_COMMIT "${GIT_COMMIT}")

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

# set mex compiler options
prepend("-I" MEX_INCLUDE_DIRS ${CMAKE_BINARY_DIR})
Expand Down Expand Up @@ -234,7 +234,7 @@ add_custom_command(
COMMAND ${PYTHON_DEFAULT_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/generator/gen_matlab.py
--hdrparser ${HDR_PARSER_PATH}
--moduleroot ${CMAKE_SOURCE_DIR}/modules ${OPENCV_EXTRA_MODULES_PATH}
--moduleroot ${OpenCV_SOURCE_DIR}/modules ${OPENCV_EXTRA_MODULES_PATH}
--modules ${opencv_modules}
--extra ${opencv_extra_hdrs}
--outdir ${CMAKE_CURRENT_BINARY_DIR}
Expand Down

0 comments on commit 087a100

Please sign in to comment.