Skip to content

Commit 6ea6e4b

Browse files
committed
binding: fix headers processing
1 parent 2db45c8 commit 6ea6e4b

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

modules/dnn/include/opencv2/dnn/dict.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@
4646
#include <map>
4747
#include <ostream>
4848

49+
#include <opencv2/dnn/dnn.hpp>
50+
4951
namespace cv {
5052
namespace dnn {
5153
CV__DNN_EXPERIMENTAL_NS_BEGIN

modules/python/common.cmake

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@ foreach(m ${OPENCV_PYTHON_MODULES})
3232
endforeach(m)
3333

3434
# header blacklist
35-
ocv_list_filterout(opencv_hdrs "modules/.*.h$")
35+
ocv_list_filterout(opencv_hdrs "modules/.*\\\\.h$")
3636
ocv_list_filterout(opencv_hdrs "modules/core/.*/cuda")
3737
ocv_list_filterout(opencv_hdrs "modules/cuda.*")
3838
ocv_list_filterout(opencv_hdrs "modules/cudev")
3939
ocv_list_filterout(opencv_hdrs "modules/core/.*/hal/")
4040
ocv_list_filterout(opencv_hdrs "modules/.+/utils/.*")
41-
ocv_list_filterout(opencv_hdrs "modules/.*/detection_based_tracker.hpp") # Conditional compilation
41+
ocv_list_filterout(opencv_hdrs "modules/.*\\\\.inl\\\\.h*")
42+
ocv_list_filterout(opencv_hdrs "modules/.*_inl\\\\.h*")
43+
ocv_list_filterout(opencv_hdrs "modules/.*\\\\.details\\\\.h*")
44+
ocv_list_filterout(opencv_hdrs "modules/.*/detection_based_tracker\\\\.hpp") # Conditional compilation
4245

4346
set(cv2_generated_hdrs
4447
"${CMAKE_CURRENT_BINARY_DIR}/pyopencv_generated_include.h"
@@ -47,7 +50,8 @@ set(cv2_generated_hdrs
4750
"${CMAKE_CURRENT_BINARY_DIR}/pyopencv_generated_type_reg.h"
4851
"${CMAKE_CURRENT_BINARY_DIR}/pyopencv_generated_ns_reg.h")
4952

50-
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/headers.txt" "${opencv_hdrs}")
53+
string(REPLACE ";" "\n" opencv_hdrs_ "${opencv_hdrs}")
54+
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/headers.txt" "${opencv_hdrs_}")
5155
add_custom_command(
5256
OUTPUT ${cv2_generated_hdrs}
5357
COMMAND ${PYTHON_DEFAULT_EXECUTABLE} "${PYTHON_SOURCE_DIR}/src2/gen2.py" ${CMAKE_CURRENT_BINARY_DIR} "${CMAKE_CURRENT_BINARY_DIR}/headers.txt" "${PYTHON}"

modules/python/src2/gen2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,6 @@ def gen(self, srcfiles, output_path):
977977
if len(sys.argv) > 1:
978978
dstdir = sys.argv[1]
979979
if len(sys.argv) > 2:
980-
srcfiles = open(sys.argv[2], 'r').read().split(';')
980+
srcfiles = [f.strip() for f in open(sys.argv[2], 'r').readlines()]
981981
generator = PythonWrapperGenerator()
982982
generator.gen(srcfiles, dstdir)

0 commit comments

Comments
 (0)