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
42ecfc55
Commit
42ecfc55
authored
Jul 23, 2014
by
Alexander Mordvintsev
Committed by
Alexander Mordvintsev
Jul 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed parsing enums with tailing comma
gen2.py reports headers it processes cmake file restructured
parent
964657a1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
29 deletions
+30
-29
CMakeLists.txt
modules/python/CMakeLists.txt
+27
-29
gen2.py
modules/python/src2/gen2.py
+1
-0
hdr_parser.py
modules/python/src2/hdr_parser.py
+2
-0
No files found.
modules/python/CMakeLists.txt
View file @
42ecfc55
...
...
@@ -12,23 +12,18 @@ endif()
set
(
the_description
"The python bindings"
)
set
(
candidate_deps
_raw
)
set
(
candidate_deps
)
foreach
(
mp
${
OPENCV_MODULES_PATH
}
${
OPENCV_EXTRA_MODULES_PATH
}
)
file
(
GLOB names
"
${
mp
}
/*"
)
list
(
APPEND candidate_deps_raw
${
names
}
)
endforeach
(
mp
)
set
(
candidate_deps
)
foreach
(
m IN LISTS candidate_deps_raw
)
if
(
IS_DIRECTORY
${
m
}
)
get_filename_component
(
m
${
m
}
NAME
)
if
(
NOT
${
m
}
MATCHES
"^cud(a|ev)"
)
if
(
NOT
${
m
}
MATCHES
"optim"
)
# unless we handle namespaces
list
(
APPEND candidate_deps
"opencv_
${
m
}
"
)
foreach
(
m IN LISTS names
)
if
(
IS_DIRECTORY
${
m
}
)
get_filename_component
(
m
${
m
}
NAME
)
if
(
NOT
${
m
}
MATCHES
"^cud(a|ev)"
)
list
(
APPEND candidate_deps
"opencv_
${
m
}
"
)
endif
()
endif
()
endif
()
endif
()
endforeach
(
m
)
endforeach
(
m
)
endforeach
(
mp
)
ocv_add_module
(
python BINDINGS OPTIONAL
${
candidate_deps
}
)
...
...
@@ -39,23 +34,26 @@ ocv_module_include_directories(
)
set
(
opencv_hdrs_raw
)
foreach
(
m IN LISTS OPENCV_MODULE_opencv_python_DEPS
)
list
(
APPEND opencv_hdrs_raw
"
${
OPENCV_MODULE_
${
m
}
_HEADERS
}
"
)
endforeach
(
m
)
set
(
opencv_hdrs_blacklist
".h$"
"opencv2/core/cuda"
"opencv2/objdetect/detection_based_tracker.hpp"
"opencv2/optim.hpp"
)
# 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
)
foreach
(
m IN LISTS OPENCV_MODULE_opencv_python_DEPS
)
foreach
(
hdr IN LISTS OPENCV_MODULE_
${
m
}
_HEADERS
)
set
(
good TRUE
)
foreach
(
s IN LISTS opencv_hdrs_blacklist
)
if
(
${
hdr
}
MATCHES
${
s
}
)
set
(
good FALSE
)
endif
()
endforeach
(
s
)
if
(
${
good
}
)
list
(
APPEND opencv_hdrs
${
hdr
}
)
endif
()
endforeach
(
hdr
)
endforeach
(
m
)
set
(
cv2_generated_hdrs
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_include.h"
...
...
modules/python/src2/gen2.py
View file @
42ecfc55
...
...
@@ -831,6 +831,7 @@ class PythonWrapperGenerator(object):
# step 1: scan the headers and build more descriptive maps of classes, consts, functions
for
hdr
in
srcfiles
:
print
(
hdr
)
decls
=
parser
.
parse
(
hdr
)
if
len
(
decls
)
==
0
:
continue
...
...
modules/python/src2/hdr_parser.py
View file @
42ecfc55
...
...
@@ -206,6 +206,8 @@ class CppHeaderParser(object):
def
parse_enum
(
self
,
decl_str
):
l
=
decl_str
ll
=
l
.
split
(
","
)
if
ll
[
-
1
]
.
strip
()
==
""
:
ll
=
ll
[:
-
1
]
prev_val
=
""
prev_val_delta
=
-
1
decl
=
[]
...
...
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