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
1d1bfd3d
Commit
1d1bfd3d
authored
Jul 22, 2014
by
Alexander Mordvintsev
Committed by
Alexander Mordvintsev
Jul 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
automatic search for headers for python wrapper generation
parent
7da0e37b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
25 deletions
+20
-25
CMakeLists.txt
modules/python/CMakeLists.txt
+17
-24
gen2.py
modules/python/src2/gen2.py
+3
-1
No files found.
modules/python/CMakeLists.txt
View file @
1d1bfd3d
...
...
@@ -19,31 +19,24 @@ ocv_module_include_directories(
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src2"
)
set
(
opencv_hdrs
"
${
OPENCV_MODULE_opencv_core_LOCATION
}
/include/opencv2/core.hpp"
"
${
OPENCV_MODULE_opencv_core_LOCATION
}
/include/opencv2/core/base.hpp"
"
${
OPENCV_MODULE_opencv_core_LOCATION
}
/include/opencv2/core/types.hpp"
"
${
OPENCV_MODULE_opencv_core_LOCATION
}
/include/opencv2/core/persistence.hpp"
"
${
OPENCV_MODULE_opencv_core_LOCATION
}
/include/opencv2/core/utility.hpp"
"
${
OPENCV_MODULE_opencv_core_LOCATION
}
/include/opencv2/core/ocl.hpp"
"
${
OPENCV_MODULE_opencv_flann_LOCATION
}
/include/opencv2/flann/miniflann.hpp"
"
${
OPENCV_MODULE_opencv_imgproc_LOCATION
}
/include/opencv2/imgproc.hpp"
"
${
OPENCV_MODULE_opencv_video_LOCATION
}
/include/opencv2/video/background_segm.hpp"
"
${
OPENCV_MODULE_opencv_video_LOCATION
}
/include/opencv2/video/tracking.hpp"
"
${
OPENCV_MODULE_opencv_photo_LOCATION
}
/include/opencv2/photo.hpp"
"
${
OPENCV_MODULE_opencv_imgcodecs_LOCATION
}
/include/opencv2/imgcodecs.hpp"
"
${
OPENCV_MODULE_opencv_videoio_LOCATION
}
/include/opencv2/videoio.hpp"
"
${
OPENCV_MODULE_opencv_highgui_LOCATION
}
/include/opencv2/highgui.hpp"
"
${
OPENCV_MODULE_opencv_ml_LOCATION
}
/include/opencv2/ml.hpp"
"
${
OPENCV_MODULE_opencv_features2d_LOCATION
}
/include/opencv2/features2d.hpp"
"
${
OPENCV_MODULE_opencv_calib3d_LOCATION
}
/include/opencv2/calib3d.hpp"
"
${
OPENCV_MODULE_opencv_objdetect_LOCATION
}
/include/opencv2/objdetect.hpp"
)
if
(
HAVE_opencv_nonfree
)
list
(
APPEND opencv_hdrs
"
${
OPENCV_MODULE_opencv_nonfree_LOCATION
}
/include/opencv2/nonfree/features2d.hpp"
"
${
OPENCV_MODULE_opencv_nonfree_LOCATION
}
/include/opencv2/nonfree.hpp"
)
endif
()
set
(
opencv_hdrs_raw
)
foreach
(
mod_name IN LISTS OPENCV_MODULE_opencv_python_DEPS
)
list
(
APPEND opencv_hdrs_raw
"
${
OPENCV_MODULE_
${
mod_name
}
_HEADERS
}
"
)
endforeach
(
mod_name
)
# remove problematic headers
set
(
opencv_hdrs
)
foreach
(
hdr IN LISTS opencv_hdrs_raw
)
if
(
NOT
${
hdr
}
MATCHES
".h$"
)
if
(
NOT
${
hdr
}
MATCHES
"opencv2/core/cuda"
)
if
(
NOT
${
hdr
}
MATCHES
"opencv2/objdetect/detection_based_tracker.hpp"
)
list
(
APPEND opencv_hdrs
${
hdr
}
)
endif
()
endif
()
endif
()
endforeach
(
hdr
)
set
(
cv2_generated_hdrs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_include.h"
...
...
modules/python/src2/gen2.py
View file @
1d1bfd3d
...
...
@@ -831,8 +831,10 @@ class PythonWrapperGenerator(object):
# step 1: scan the headers and build more descriptive maps of classes, consts, functions
for
hdr
in
srcfiles
:
self
.
code_include
.
write
(
'#include "{}"
\n
'
.
format
(
hdr
[
hdr
.
rindex
(
'opencv2/'
):])
)
decls
=
parser
.
parse
(
hdr
)
if
len
(
decls
)
==
0
:
continue
self
.
code_include
.
write
(
'#include "{}"
\n
'
.
format
(
hdr
[
hdr
.
rindex
(
'opencv2/'
):])
)
for
decl
in
decls
:
name
=
decl
[
0
]
if
name
.
startswith
(
"struct"
)
or
name
.
startswith
(
"class"
):
...
...
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